Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Reformular esta macro, ordenar por orden alfabético.

publicado

Buenas mi pregunta es la siguiente,

 Tengo esta macro:

--------------------------------------------------------------------------------

Sub orde()

    Range("B17:B46").Select

    ActiveWorkbook.Worksheets("AFILIACIÓN").Sort.SortFields.Clear

    ActiveWorkbook.Worksheets("AFILIACIÓN").Sort.SortFields.Add Key:=Range("B17"), _

        SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal

    With ActiveWorkbook.Worksheets("AFILIACIÓN").Sort

        .SetRange Range("B17:K46")

        .Header = xlNo

        .MatchCase = False

        .Orientation = xlTopToBottom

        .SortMethod = xlPinYin

        .Apply

    End With

End Sub

 -------------------------------------------------------------------------------

Bueno hasta hay corre bien la macro, pero quiero que me haga una pregunta antes de proceder con la macro, con un mensaje de aceptar el orden alfabético o no aceptar el orden alfabético.

Gracias espero su ayuda.

Editado el por 6luishao6
Mal redactado

Featured Replies

publicado
If MsgBox("¿ Desea continuar con la ordenación ?", vbQuestion + vbYesNo) = vbYes Then

'aquí tu macro

End If

 

publicado
  • Autor

Sub orde()

If MsgBox("¿ Desea continuar con la ordenación ?", vbQuestion + vbYesNo) = vbYes Then

Range("B17:B46").Select

    ActiveWorkbook.Worksheets("AFILIACIÓN").Sort.SortFields.Clear

    ActiveWorkbook.Worksheets("AFILIACIÓN").Sort.SortFields.Add Key:=Range("B17"), _

        SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal

    With ActiveWorkbook.Worksheets("AFILIACIÓN").Sort

        .SetRange Range("B17:K46")

        .Header = xlNo

        .MatchCase = False

        .Orientation = xlTopToBottom

        .SortMethod = xlPinYin

        .Apply

    End With

End Sub

end if

-------------------------------

Asi?...

publicado
Sub orde()
If MsgBox("¿ Desea continuar con la ordenación ?", vbQuestion + vbYesNo) = vbYes Then
   Range("B17:B46").Select
   ActiveWorkbook.Worksheets("AFILIACIÓN").Sort.SortFields.Clear
   ActiveWorkbook.Worksheets("AFILIACIÓN").Sort.SortFields.Add Key:=Range("B17"), _
       SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
   With ActiveWorkbook.Worksheets("AFILIACIÓN").Sort
       .SetRange Range("B17:K46")
       .Header = xlNo
       .MatchCase = False
       .Orientation = xlTopToBottom
       .SortMethod = xlPinYin
       .Apply
   End With
End If
End Sub

 

  • Enigma25 bloqueó este tema

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.