mayday1
Board Regular
- Joined
- Oct 5, 2007
- Messages
- 241
The code below deletes rows if column B is empty. It works fine but does about 1 or 2 rows per second and it sometimes has to go through a couple thousand rows. I never know how many rows will be in my file - sometimes 1000, sometimes 4000. I set the limit at 4500 but it's possible there could be more. Is there a faster way?
Dim lRow As Long
Dim iCntr As Long
lRow = 4500
For iCntr = lRow To 1 Step -1
If Cells(iCntr, 2).Value = "" Then
Rows(iCntr).Delete
Application.StatusBar = iCntr
End If
Next
Dim lRow As Long
Dim iCntr As Long
lRow = 4500
For iCntr = lRow To 1 Step -1
If Cells(iCntr, 2).Value = "" Then
Rows(iCntr).Delete
Application.StatusBar = iCntr
End If
Next