Hi I need a little help please
I have put some code together to delete an entire row if a cell in a list starting from B4 and is a variable length.
The code is sort of working but once it gets to a point where there are two or more blank cells in the list it is leaving some blank cells. I know I have got to get the code to step back on row but cannot get it to work.
Any help is much appreciated
I have put some code together to delete an entire row if a cell in a list starting from B4 and is a variable length.
The code is sort of working but once it gets to a point where there are two or more blank cells in the list it is leaving some blank cells. I know I have got to get the code to step back on row but cannot get it to work.
Any help is much appreciated
Code:
Sub DeleteRows1()
If Sheets("Sheet1").Visible = xlSheetVisible Then
Sheets("Sheet1").Select
Dim myLstRng As Range
LastRow = Cells(Rows.Count, "B").End(xlUp).Row
Set myLstRng = Sheets("Sheet1").Range("B4:B" & LastRow)
For Each rng In myLstRng
If rng = "" Then
rng.EntireRow.Delete shift:=xlUp
End If
Next rng
Else
End If
ActiveWorkbook.Save
End Sub