Ryanblades
New Member
- Joined
- Jan 17, 2018
- Messages
- 2
Hello all,
I am in need of looping the macro code below
Sub Test()
If Range("D2") = "Secondary" Then Range("J2,I2,R2,S2,T2").ClearContents
End Sub
The code above works great for the one line it is clearing but..
I need it to test conditions from 2 to 6000 on each column
If Range("D2") = "Secondary" Then Range("J2,I2,R2,S2,T2").ClearContents
...
...
If Range("D6000") = "Secondary" Then Range("J6000,I6000,R6000,S6000,T6000").ClearContents
Any way to loop this without having to hand type every line?
Thank you for any help
I am in need of looping the macro code below
Sub Test()
If Range("D2") = "Secondary" Then Range("J2,I2,R2,S2,T2").ClearContents
End Sub
The code above works great for the one line it is clearing but..
I need it to test conditions from 2 to 6000 on each column
If Range("D2") = "Secondary" Then Range("J2,I2,R2,S2,T2").ClearContents
...
...
If Range("D6000") = "Secondary" Then Range("J6000,I6000,R6000,S6000,T6000").ClearContents
Any way to loop this without having to hand type every line?
Thank you for any help