I am trying to have the value in cell A1 which is dal be the basis to clear the values in cells a5 to a500. The below formula does not work for the loop function; help much appreciated.
-------------
Option Explicit
Sub test()
Dim x As Variant
Dim y As Long
x = Cells(1, 1).Value
MsgBox x
y = 5
For y = y To 500 Step 1
If Cells(y, 1).Value = x Then
Cells(y, 1).Clear
End If
Next y
End Sub
-------------
Option Explicit
Sub test()
Dim x As Variant
Dim y As Long
x = Cells(1, 1).Value
MsgBox x
y = 5
For y = y To 500 Step 1
If Cells(y, 1).Value = x Then
Cells(y, 1).Clear
End If
Next y
End Sub