Hello,
I have a macro which checks a cell to see if its blank and then if it is it deletes the row. I originally used it to check 96 rows for which it was fine. But now I have to use it for 15500 rows and it tkes over 10 min. Does anyone know of a way to do this faster? Ive included the code below
Thanks for any help
Casey
Dim Counter
Dim i As Integer
' Input box to determine the total number of rows in the worksheet.
Counter = 15500
ActiveCell.Select
' Loops through the desired number of rows.
For i = 1 To Counter
' Checks to see if the active cell is blank.
If ActiveCell = "" Then
Selection.EntireRow.Delete
' Decrements count each time a row is deleted. This ensures
' that the macro will not run past the last row.
Counter = Counter - 1
Else
' Selects the next cell.
ActiveCell.Offset(1, 0).Select
End If
Next i
I have a macro which checks a cell to see if its blank and then if it is it deletes the row. I originally used it to check 96 rows for which it was fine. But now I have to use it for 15500 rows and it tkes over 10 min. Does anyone know of a way to do this faster? Ive included the code below
Thanks for any help
Casey
Dim Counter
Dim i As Integer
' Input box to determine the total number of rows in the worksheet.
Counter = 15500
ActiveCell.Select
' Loops through the desired number of rows.
For i = 1 To Counter
' Checks to see if the active cell is blank.
If ActiveCell = "" Then
Selection.EntireRow.Delete
' Decrements count each time a row is deleted. This ensures
' that the macro will not run past the last row.
Counter = Counter - 1
Else
' Selects the next cell.
ActiveCell.Offset(1, 0).Select
End If
Next i