Forum Discussion
StevenP2205
Oct 29, 2024Copper Contributor
Excel Macros
Hi everyone, I am trying to figure out how to make a macro that will show and hide up multiple tabs in a excel spreadsheet by using a ActiveX Checkbox. I am able to show a tab by clicking on that d...
StevenP2205
Oct 29, 2024Copper Contributor
So I have figured out how to unhide them when the checkbox is checked but cant figure out how the rest of the code to hide them again once its unchecked. Here is what i have so far:
Private Sub CheckBox1_Click()
Dim sh As Excel.Worksheet
For Each sh In Sheets(Array("Sheet2", "Sheet3", "Sheet4"))
sh.Visible = Not CheckBox2.Value
Next
End Sub