Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
need code for hiding/unhiding sheets using checkboxes pzx8hf Excel Worksheet Functions 1 August 13th 08 12:11 AM
Hiding Control Toolbar Checkboxes Ellen G Excel Discussion (Misc queries) 2 September 24th 07 09:59 PM
Hiding Rows with Checkboxes Ellen G Excel Discussion (Misc queries) 1 April 6th 07 08:00 PM
Why not introducing worksheet for business students in MS EXCEL? Syed Ibne Ali Excel Discussion (Misc queries) 1 April 10th 05 01:28 PM
hiding showing columns using checkboxes ronda Excel Programming 1 June 8th 04 01:27 AM


All times are GMT +1. The time now is 07:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"