Ver Mensaje Individual
  #3 (permalink)  
Antiguo 23/07/2008, 14:20
Avatar de mrocf
mrocf
 
Fecha de Ingreso: marzo-2007
Ubicación: Bs.As.
Mensajes: 1.103
Antigüedad: 17 años
Puntos: 88
De acuerdo Respuesta: EXCEL VBA- Borrar filas masivamente


Hola! Uka.
Este procedimiento elimina 600 filas de un total de 10.000 en 2 segundos. Su velocidad se debe a que elimina de a 50 filas simultáneamente.

Código:
Sub BorrarFilasMasivamente()
Application.ScreenUpdating = False
timecalc = Time
msg = "Se eliminaron " & WorksheetFunction.CountIf([E:E], "0") & _
  " filas de un total de " & WorksheetFunction.Count([E:E]) & " en "

For ii = [E1].End(xlDown).Row To 1 Step -1
  If Cells(ii, [E1].Column) = "0" Then
    Conj = Conj & "," & "E" & ii
    If Len(Conj) > 248 Then
      Range(Right(Conj, Len(Conj) - 1)).EntireRow.Delete: Conj = Empty
    End If
  End If
Next ii

If Conj <> Empty Then Range(Right(Conj, Len(Conj) - 1)).EntireRow.Delete

Application.ScreenUpdating = True
MsgBox msg & Format(Time - timecalc, "s") & " segundos."
End Sub
Saludos

Última edición por mrocf; 23/07/2008 a las 16:36