General discussion


CheckBoxes in Excel

By leed ·
I'm not sure if this is the right place for my question but i'll ask anyway.

In Excel i want to add a CheckBox, when it is checked i want a certain amount of worksheets to become Hidden.

How do i do it?

Any help will be much appreciated.

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by PubServant In reply to CheckBoxes in Excel

Try this.

Open an Excel worksheet. For this example, I used the default three sheets.
From the Control Toolbox add a CheckBox to Sheet1. Change the Name property to something appropriate such as "Hide Sheets".

The following code for the CheckBox Click method will hide Sheets 2 and 3 when the CheckBox is checked, and will display them when unchecked.

Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
Sheet2.Visible = xlSheetHidden
Sheet3.Visible = xlSheetHidden
Sheet2.Visible = xlSheetVisible
Sheet3.Visible = xlSheetVisible
End If
End Sub

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums