Una familia de software de hoja de cálculo de Microsoft con herramientas para analizar, trazar y comunicar datos.
Hola pepeeeee:
Utilicé el siguiente código con una hoja con 609.717 filas, tardó 66 segundos en eliminar las filas vacías, conservando el orden original de la misma. Como lo mencionaba anteriormente este mismo proceso sin ordenar tomaba cerca de dos horas. Espero sea de utilidad.
Sub EliminaFilasVacias()
Dim NumFil As Double
Dim NumCol As Double
Dim HojaRango As Range
Dim tProceso As Double
tProceso = Timer()
Application.ScreenUpdating = False
Application.Calculation = xlManual
Range("A1").Select
Set HojaRango = Range(Selection, ActiveCell.SpecialCells(xlLastCell))
NumFil = HojaRango.Rows.Count
NumCol = HojaRango.Columns.Count + 1
Cells(1, NumCol).Value = 1
Range(Cells(1, NumCol), Cells(NumFil, NumCol)).DataSeries _
Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, _
Step:=1, Trend:=False
Set HojaRango = Nothing
Set HojaRango = Range(Selection, ActiveCell.SpecialCells(xlLastCell))
HojaRango.Select
With ActiveWorkbook.Worksheets(ActiveSheet.Name).Sort
.SortFields.Clear
.SortFields.Add Key:=Range("E" & "1" & ":" & "E" & NumFil), _
SortOn:=xlSortOnValues, _
Order:=xlAscending, _
DataOption:=xlSortNormal
.SetRange HojaRango
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Columns("E" & ":" & "E").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
HojaRango.Select
With ActiveWorkbook.Worksheets(ActiveSheet.Name).Sort
.SortFields.Clear
.SortFields.Add Key:=Range(Cells(1, NumCol), Cells(NumFil, NumCol)), _
SortOn:=xlSortOnValues, _
Order:=xlAscending, _
DataOption:=xlSortNormal
.SetRange HojaRango
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Cells(1, NumCol).EntireColumn.Delete
Application.Calculation = xlAutomatic
Application.ScreenUpdating = True
Range("A1").Select
MsgBox "Tiempo utilizado = " & (Timer() - tProceso) & " segundos"
End Sub
Saludos...