Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
checkboxes hiding or introducing new worksheets
Hi, I'll try and keep this brief!
I'd like to be able to control the visibility of certain sheets within my workbook using checkboxes. I.e. on one worksheet is a index of items which each have a separate worksheet dedicated to them. Is it possible to control the visibility of these individual sheets by the user ticking the checkbox next to the related item on the index sheet? I tried assigning the following code to a forms checkbox, but get a 424 error on the second line: Sub CheckBox1_Click() If CheckBox1.Value = True Then Sheets("Item 1").Visible = True Else Sheets("Item 1").Visible = False End If End Sub What am I doing wrong (I'm a bit of an amateur!)??! Also, thought I'd ask this but really don't know if it's possible: Can I use the same above checkbox to import a worksheet from another file when checked? This would be a major advantage in keeping file size down rather than having a dozen hidden sheets?! Thanks for all/any help Gareth |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
checkboxes hiding or introducing new worksheets
Works fine for me.
Are you sure that you used control toolbox checkboxes, and you put the code in the worksheet module? -- HTH RP "el_peacock" wrote in message ... Hi, I'll try and keep this brief! I'd like to be able to control the visibility of certain sheets within my workbook using checkboxes. I.e. on one worksheet is a index of items which each have a separate worksheet dedicated to them. Is it possible to control the visibility of these individual sheets by the user ticking the checkbox next to the related item on the index sheet? I tried assigning the following code to a forms checkbox, but get a 424 error on the second line: Sub CheckBox1_Click() If CheckBox1.Value = True Then Sheets("Item 1").Visible = True Else Sheets("Item 1").Visible = False End If End Sub What am I doing wrong (I'm a bit of an amateur!)??! Also, thought I'd ask this but really don't know if it's possible: Can I use the same above checkbox to import a worksheet from another file when checked? This would be a major advantage in keeping file size down rather than having a dozen hidden sheets?! Thanks for all/any help Gareth |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
checkboxes hiding or introducing new worksheets
Ah - I see, I used the code on a control toolbox beckbox and it worked fine
(was using a forms checkbox before)! Cheers for the help. "Bob Phillips" wrote: Works fine for me. Are you sure that you used control toolbox checkboxes, and you put the code in the worksheet module? -- HTH RP "el_peacock" wrote in message ... Hi, I'll try and keep this brief! I'd like to be able to control the visibility of certain sheets within my workbook using checkboxes. I.e. on one worksheet is a index of items which each have a separate worksheet dedicated to them. Is it possible to control the visibility of these individual sheets by the user ticking the checkbox next to the related item on the index sheet? I tried assigning the following code to a forms checkbox, but get a 424 error on the second line: Sub CheckBox1_Click() If CheckBox1.Value = True Then Sheets("Item 1").Visible = True Else Sheets("Item 1").Visible = False End If End Sub What am I doing wrong (I'm a bit of an amateur!)??! Also, thought I'd ask this but really don't know if it's possible: Can I use the same above checkbox to import a worksheet from another file when checked? This would be a major advantage in keeping file size down rather than having a dozen hidden sheets?! Thanks for all/any help Gareth |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
need code for hiding/unhiding sheets using checkboxes | Excel Worksheet Functions | |||
Hiding Control Toolbar Checkboxes | Excel Discussion (Misc queries) | |||
Hiding Rows with Checkboxes | Excel Discussion (Misc queries) | |||
Why not introducing worksheet for business students in MS EXCEL? | Excel Discussion (Misc queries) | |||
hiding showing columns using checkboxes | Excel Programming |