rahul_r79
05-20-2010, 06:07 PM
Hi
I just need a help to clear the contents of the cells if the value in the adjacent cell is empty
For ex
J1= 0 then L1 should be zero(means -clear the contents)
till the end of the row.
I had tried to write a macro but its giving an Error Mismatch
My VBA Code is as follows:-
Dim rng1 As Range
Dim rng2 As Range
Set rng1 = ActiveSheet.Range("J3:j100")
Set rng2 = ActiveSheet.Range("L3:L100")
'Set rng2 = Worksheets("sheet2").Range("a1:c5")
Do While rng1.Value = ""
rng2.ClearContents
Loop
End Sub
I just need a help to clear the contents of the cells if the value in the adjacent cell is empty
For ex
J1= 0 then L1 should be zero(means -clear the contents)
till the end of the row.
I had tried to write a macro but its giving an Error Mismatch
My VBA Code is as follows:-
Dim rng1 As Range
Dim rng2 As Range
Set rng1 = ActiveSheet.Range("J3:j100")
Set rng2 = ActiveSheet.Range("L3:L100")
'Set rng2 = Worksheets("sheet2").Range("a1:c5")
Do While rng1.Value = ""
rng2.ClearContents
Loop
End Sub