I have tried to write code to delete all rows where there is a value in Col H on sheet2 from row 2 onwards
I get a run time error "Invalid pprocedure call or argument" and the code below is highlighted
It would be appreciated if someone could kindly amend my code
I get a run time error "Invalid pprocedure call or argument" and the code below is highlighted
Code:
If .Cells("H" & I).Value <> "" Then
Code:
Sub Delete_row_ColH()
Dim LR As Long, I As Long
With Sheets(2)
LR = .Cells(.Rows.Count, "A").End(xlUp).Row
For I = LR To 2 Step -1
If .Cells("H" & I).Value <> "" Then
.Cells("H" & I).EntireRow.Delete
End If
Next I
End With
End Sub
It would be appreciated if someone could kindly amend my code