Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default hide and unhde worksheets when a set button on a form is clicked

hi everyone,
i have a work book with 4 worksheets i have a userform that is initialised
when the workbook is opened. on the form is 4 buttons one for each sheet.
button one would show the worksheet tabs for sheets 1 and 2,
button two would show the worksheet tabs for sheets 1 and 3,
button three would show the worksheet tabs for sheet 1,
button four would show the worksheet tabs for sheets 1 and 4,

i'm taking it that by hiding the worksheet tabs that the worksheet itself is
hidden!

help in this dilema is very much appreciated.
thank you

Dave ferris
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default hide and unhde worksheets when a set button on a form is clicked


Dave ferris;160515 Wrote:
i have a work book with 4 worksheets i have a userform that is
initialised
when the workbook is opened. on the form is 4 buttons one for each
sheet.
button one would show the worksheet tabs for sheets 1 and 2,
button two would show the worksheet tabs for sheets 1 and 3,
button three would show the worksheet tabs for sheet 1,
button four would show the worksheet tabs for sheets 1 and 4,

i'm taking it that by hiding the worksheet tabs that the worksheet
itself is
hidden!

Your only question is "does hiding the tab make the sheet hidden, too?"
If so, yes, the sheet is hidden. Unless the sheets are password
protected in some way, though, they can be rather easily unhidden, too,
by the user.

Did you have some other question?


--
JBeaucaire
------------------------------------------------------------------------
JBeaucaire's Profile: http://www.thecodecage.com/forumz/member.php?userid=73
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=44613

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default hide and unhde worksheets when a set button on a form is clicked

In the UserForm code window put this code for the Option Buttons:

Private Sub OptionButton1_Click()
Sheet1.Visible = True
Sheet2.Visible = True
Sheet3.Visible = False
Sheet4.Visible = False
End Sub

Private Sub OptionButton2_Click()
Sheet1.Visible = True
Sheet2.Visible = False
Sheet3.Visible = True
Sheet4.Visible = False
End Sub

Private Sub OptionButton3_Click()
Sheet1.Visible = True
Sheet2.Visible = False
Sheet3.Visible = False
Sheet4.Visible = False
End Sub

Private Sub OptionButton4_Click()
Sheet1.Visible = True
Sheet2.Visible = False
Sheet3.Visible = False
Sheet4.Visible = True
End Sub

Mike F
"Dave ferris" wrote in message
...
hi everyone,
i have a work book with 4 worksheets i have a userform that is initialised
when the workbook is opened. on the form is 4 buttons one for each sheet.
button one would show the worksheet tabs for sheets 1 and 2,
button two would show the worksheet tabs for sheets 1 and 3,
button three would show the worksheet tabs for sheet 1,
button four would show the worksheet tabs for sheets 1 and 4,

i'm taking it that by hiding the worksheet tabs that the worksheet itself
is
hidden!

help in this dilema is very much appreciated.
thank you

Dave ferris



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default hide and unhde worksheets when a set button on a form is clicked


The code above would work, but without some extra work on your part,
users would be able to easily make the other sheets visible again.

Use the VeryHidden attribute to make the sheets unviewable without more
VBA code.


--
JBeaucaire
------------------------------------------------------------------------
JBeaucaire's Profile: http://www.thecodecage.com/forumz/member.php?userid=73
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=44613

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
Hide or display worksheets based on form Shawnn Excel Discussion (Misc queries) 3 December 31st 08 10:58 PM
Issue with workbook not being selected when form button is clicked robs3131 Excel Programming 3 February 16th 08 12:01 AM
how to hide a form button in a worksheet angie ng Excel Discussion (Misc queries) 1 May 21st 07 01:08 PM
Hide a form button Michael Singmin Excel Programming 1 September 16th 04 06:23 PM
Pause macro, add form button to sheet, continue macro when button clicked! Flystar[_15_] Excel Programming 1 May 26th 04 09:45 AM


All times are GMT +1. The time now is 06:54 AM.

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

About Us

"It's about Microsoft Excel"