![]() |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 07:24 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com