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.

Si celda esta Vacia No ejecutar macro

publicado

Buen dia!

Tengo esta inquietud..

Tengo esta formula

Sub ordenarfiltro()

    Sheets("Mantenimiento").Activate
    Range("a2").Select
    Range("A2:J2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Sort Key1:=Range("a3"), Order1:=xlDescending, Header:=xlGuess, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal

End Sub

Ahora yo quiero que si la celda "A2" esta vacia, la macro no corra. Osea que no pase nada..
eso es para el caso de que aun no se hayan llenado valores en la tabla.
 

Simplemente eso..

 

Gracias!!

Featured Replies

publicado

Prueba

Sub ordenarfiltro()

Sheets("Mantenimiento").Activate
Range("A2").Select

If Range("A2").Value = 0 Or Range("A2").Value = "" Or Range("A2").Value = Empty Then

Exit Sub

Else
Range("A2:J2").Select
Range(Selection, Selection.End(xlDown)).Select

Selection.Sort Key1:=Range("a3"),Order1:=xlDescending, Header:=xlGuess, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal

End If

End Sub

 

Saludos!!

publicado
  • Autor

Excelente!!! Funciono perfecto!

Muchísimas gracias!!!

 

 

Tema cerrado!

  • Silvia 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.