R
ronda
Hoping someone can help - I'm sure this is simple - I just can't get i
to work
I have 2 checkboxes to show and hide information - from browsing thi
forum I have come up with the following:
Private Sub CheckBox1_Click()
Dim r As Range
Set r = Range("G1:H1")
r.EntireColumn.Hidden = Not r.EntireColumn.Hidden
End Sub
Private Sub CheckBox2_Click()
Dim r As Range
Set r = Range("M1:AM1")
r.EntireColumn.Hidden = Not r.EntireColumn.Hidden
End Sub
Both of these work fine idependently - however when I check one and no
the other sometimes it works and sometimes it doesn't.
What I am looking to do is the following
if cbox1 is true and cbox2 is true it needs to show columns a-l,an-aw
if cbox1 is false and cbox2 is true it needs to show column
a-f,j-l,an-ap
if cbox1 is true and cbox2 is false it needs to show everything
if cbox 1 is false and cbox2 is false it needs to show column
a-f,j-o,r-x,aa-ag,aj-ap
I have tried various if/then statements but the results still are no
consistent
any suggestions are appreciate
to work
I have 2 checkboxes to show and hide information - from browsing thi
forum I have come up with the following:
Private Sub CheckBox1_Click()
Dim r As Range
Set r = Range("G1:H1")
r.EntireColumn.Hidden = Not r.EntireColumn.Hidden
End Sub
Private Sub CheckBox2_Click()
Dim r As Range
Set r = Range("M1:AM1")
r.EntireColumn.Hidden = Not r.EntireColumn.Hidden
End Sub
Both of these work fine idependently - however when I check one and no
the other sometimes it works and sometimes it doesn't.
What I am looking to do is the following
if cbox1 is true and cbox2 is true it needs to show columns a-l,an-aw
if cbox1 is false and cbox2 is true it needs to show column
a-f,j-l,an-ap
if cbox1 is true and cbox2 is false it needs to show everything
if cbox 1 is false and cbox2 is false it needs to show column
a-f,j-o,r-x,aa-ag,aj-ap
I have tried various if/then statements but the results still are no
consistent
any suggestions are appreciate