Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Peter,
I did this in Excel 97. Put check boxes from the Forms Toolbar on your worksheet. Change the caption of the checkboxs to the worksheet names. Than use this code for each checkbox (besure to have CB1, CB2, etc) Or better yet use a command button to fire the macro ShowHideSheet. ShowHideSheet will look at all the checkboxes and hide/unhide the sheets. Sub CheckBox1_Click() ShowHideSheet End Sub Sub ShowHideSheet() Dim OLEObj As OLEObject Dim myCBX As CheckBox For Each myCBX In ActiveSheet.CheckBoxes If myCBX.Value = 1 Then Sheets(myCBX.Caption).Visible = True Else Sheets(myCBX.Caption).Visible = False End If Next myCBX End Sub -- sb "Peter" wrote in message ... I am tyring to create control sheet using forms control that would hide or unhide depending if the box is checked or not. Ideally, when the box is checked it would pass the worksheet name to my vba code to hide/unhide the named worksheet. Where I'm running into trouble is creating a macro that can be assigned to the checkbox. Not sure if I am using the best approach to doing this and would appreciate any suggestions. Thanks, Peter |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
hide, unhide column or row after protect worksheet | Excel Discussion (Misc queries) | |||
how do I protect a worksheet and still use a checkbox control | Excel Worksheet Functions | |||
Can I hide a worksheet and set a passwd to unhide it? | Excel Discussion (Misc queries) | |||
Can I hide a worksheet and set a passwd to unhide it? | Excel Worksheet Functions | |||
Checkbox to hide and unhide rows Please. | Excel Worksheet Functions |