The following code for deleting blank rows within a range has stopped working for me. I need help with direction for how to make it start working again.
Here is the message dialog box that popped up when I did a "Step In" to see if I could figure out what was wrong with the code:
Run-time error '1004':
Delete method of Range class failed
Thanks
- - - - - - -
Sub DeleteRow()
Dim lLastRow As Long, l As Long
lLastRow = Range("A" & Rows.Count).End(xlUp).Row
'Start at bottom row and work up finishing at row 2(change as required)
For l = lLastRow To 11 Step -1
If Range("A" & l) = "" Then Rows(l).Delete
Next
End Sub
Here is the message dialog box that popped up when I did a "Step In" to see if I could figure out what was wrong with the code:
Run-time error '1004':
Delete method of Range class failed
Thanks
- - - - - - -
Sub DeleteRow()
Dim lLastRow As Long, l As Long
lLastRow = Range("A" & Rows.Count).End(xlUp).Row
'Start at bottom row and work up finishing at row 2(change as required)
For l = lLastRow To 11 Step -1
If Range("A" & l) = "" Then Rows(l).Delete
Next
End Sub