In column D, I am trying to delete every row that has a value in it. If the cell is blank, it is not deleted
The For loop only looks at D2 and deletes the entire row because it has a value in it. The loop then stops, and does not continue. The NumRows value is 9324 because there are that many rows in column A.
I'm stuck and cannot figure out how to get the loop to continue. Thanks!
Dim VarDeleteLoop as long
Dim NumRows As Long
NumRows = Worksheets("Sheet").Cells(Application.Rows.Count, "A").End(xlUp).Row
For VarDeleteLoop = 2 To NumRows
Cells(VarDeleteLoop, 4).Select
If Cells(VarDeleteLoop, 4).Value = "" Then
Cells(VarDeleteLoop, 4).Select
Else
Cells(VarDeleteLoop, 4).Select
Selection.EntireRow.Delete
End If
Next VarDeleteLoop
Application.Rows.CounttoWorksheets("Sheet").Rows.Count