koi
Member
Hi All,
I have a range of data from A3:J100, and i need the code to delete range A3:E100 (can be lastrow as well) if it find zero on column A3:A100
basically something like below, but somehow this code doesnt work, Thanks for helping me
I have a range of data from A3:J100, and i need the code to delete range A3:E100 (can be lastrow as well) if it find zero on column A3:A100
basically something like below, but somehow this code doesnt work, Thanks for helping me
Code:
Sub DeleteRange()
Dim r As Long
Dim LastRow As Long
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For r = LastRow To 1 Step -1
If Cells(r, "A") = 0 Then
Range("A3:E" & LastRow).Delete
End If
Next r
End Sub