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.

Mejorar tiempo de ejecucion macros, Eliminar Filas

publicado

Tengo este codigo el cual me recorre las filas evaluando la columna "E", en este caso evalua si en la columna tiene estos datos "Pajaritos No. 1" o "Pajaritos No. 2", y si es asi, que elimine la fila completa, pero al ejecturala se alenta mucho el proceos tarda como 1 min o aveces mas.

 

Como puedo mejorar esto.

 

Saludos

 

 

Sub borrarFilas()


    Dim ultimaFila As Long
    Dim fila As Long
      ultimaFila = Hoja1.Cells(Rows.Count, "E").End(xlUp).Row
    
    

    
    
    For fila = 5 To ultimaFila
    
        If Hoja1.Cells(fila, 5) = "Pajaritos No. 1" Or Hoja1.Cells(fila, 5) = "Pajaritos No. 2" Then
            Hoja1.Rows(fila).EntireRow.Delete
            ultimaFila = ultimaFila - 1
            fila = fila - 1
        End If
        If ultimaFila = fila Then
            MsgBox "Proceso terminado exitosamente!"
          
            Exit Sub
        End If
    Next fila
    
    
    
    
    
End Sub

Featured Replies

publicado

Buenas tardes, solucion usando AutoFiltro

With ActiveSheet
    .Range("E5").AutoFilter Field:=1, Criteria1:= _
        "=Pajaritos No. 1", Operator:=xlOr, Criteria2:="=Pajaritos No. 2"
    .AutoFilter.Range.Offset(0, 0).EntireRow.Delete
     MsgBox "Proceso terminado exitosamente!"
End With

Saludos

publicado
  • Autor

Muchas gracias por el apoyo

Ya lo realice, pero al ejecutar el codigo me indica que convierta mi tabla a rango, ya que es una tabla,

como le podria hacer ahiii, saludos

publicado

Buenas, si es tabla , donde Tabla2 = Nombre de tu tabla

 ActiveSheet.ListObjects("Tabla2").Range.AutoFilter Field:=1, Criteria1:= _
        "=Pajaritos No. 1", Operator:=xlOr, Criteria2:="=Pajaritos No. 2"
    Range("Tabla2[Nombres]").Select
    Selection.EntireRow.Delete
    ActiveSheet.ListObjects("Tabla2").Range.AutoFilter Field:=1
    Range("E5").Select

saludos

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.