I am trying to select a range of rows, then hide or unhide them. here is some sample code:
Dim Var1 as range
Dim Var2 as range
Set Var1 = Sheets("Sample").Range("22:25")
Set Var2 = Sheets("Sample").Range("28:33")
Range("Var1,Var2").EntireRow.Hidden = True (this is the error line)
I get an error, but it will work if I do this:
Var1.EntireRow.Hidden = True
The issue is that my list of varibles is 28 and must be interchangeable.
Thanks for any suggestions!
Dim Var1 as range
Dim Var2 as range
Set Var1 = Sheets("Sample").Range("22:25")
Set Var2 = Sheets("Sample").Range("28:33")
Range("Var1,Var2").EntireRow.Hidden = True (this is the error line)
I get an error, but it will work if I do this:
Var1.EntireRow.Hidden = True
The issue is that my list of varibles is 28 and must be interchangeable.
Thanks for any suggestions!