Hi,
I’m new to VBA, as you’ll guess from my question, and am hoping somebody can help please.
I’m trying to hide a large number of rows based on values in 1 column - ie if A1 = 1 or 2 then hide row 1, if A2 = 1 or 2 then hide row 2 and so on down the rows.
The code below works but the thought of replicating it for a couple of hundred rows isn’t filling me with joy!!! Please can somebody put me out of my misery?
If range(“A1”) = 1 Then Rows(“1:1”).EntireRow.Hidden=True
If range(“A1”) = 2 Then Rows(“1:1”).EntireRow.Hidden=True
Any help is very much appreciated. Thank you
I’m new to VBA, as you’ll guess from my question, and am hoping somebody can help please.
I’m trying to hide a large number of rows based on values in 1 column - ie if A1 = 1 or 2 then hide row 1, if A2 = 1 or 2 then hide row 2 and so on down the rows.
The code below works but the thought of replicating it for a couple of hundred rows isn’t filling me with joy!!! Please can somebody put me out of my misery?
If range(“A1”) = 1 Then Rows(“1:1”).EntireRow.Hidden=True
If range(“A1”) = 2 Then Rows(“1:1”).EntireRow.Hidden=True
Any help is very much appreciated. Thank you