Hi again,
I am needing to delete rows if a cell contains a 0 or is a empty cell. I have some code that partially works but stops two rows short of the top. Any idea why? Below is a snippit of the data set and the code I am using. I am so very new to this.
I am needing to delete rows if a cell contains a 0 or is a empty cell. I have some code that partially works but stops two rows short of the top. Any idea why? Below is a snippit of the data set and the code I am using. I am so very new to this.
VBA Code:
'Deletes Zero Linear Foot of Advance Rows
Dim lastRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Adjusted")
lastRow = ws.Cells(ws.Rows.Count, 6).End(xlUp).Row
For i = lastRow To 6 Step -1
If ws.Cells(i, 6).Value = 0 Or ws.Cells(i, 6).Value = "0" Then
ws.Cells(i, 6).EntireRow.Delete
End If
Next i