Hiding Tabs until needed

jabryantiii

Board Regular
Joined
Sep 18, 2009
Messages
129
Looking for a way to hide tab(s) until a button is clicked to move to the next tab. Basically I am looking to set up a "dashboard" page as a starting point. Once some infromation is input and a button is clicked the next page is opened and unhidden. Is that possible??
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

sijpie

Well-known Member
Joined
Nov 1, 2008
Messages
3,734
sheets("Sheet2").visible = false

to hide

and =true to show
 

taigovinda

Well-known Member
Joined
Mar 28, 2007
Messages
2,639
This will hide the current tab and unhide the next one:

Code:
Private Sub CommandButton1_Click()
    Sheets(ActiveSheet.Index + 1).Visible = True
    ActiveSheet.Visible = xlVeryHidden 'cannot be unhidden without code; remove "Very" to hide normally.
End Sub
 

jabryantiii

Board Regular
Joined
Sep 18, 2009
Messages
129
that hides the sheet once i click the button, I am looking for a way to have sheets hidden prior, so once the button is clicked it unhides the next (goto) sheet.
 

taigovinda

Well-known Member
Joined
Mar 28, 2007
Messages
2,639

ADVERTISEMENT

The code in post#3 hides the current sheet AND unhides the next one... what are you looking for the button to do exactly? When you click it, what should happen?
 

jabryantiii

Board Regular
Joined
Sep 18, 2009
Messages
129
when i created the "dashboard" page, the code does not seem to hide anthing more then the dashboard tab itself. What i am looking to accomplish is having all the tabs minus the dashboard tab, hidden until the button is clicked. Once clicked it unhides the next tab. I would add this button to every page so that once it is clicked it only unhides the next tab the button is associated with.
 

taigovinda

Well-known Member
Joined
Mar 28, 2007
Messages
2,639
You can put this into the workbook code (right-click the Excel logo at the top left of the screen, view code, paste this in):

Code:
Private Sub Workbook_Open()
For Each sht In Sheets
    sht.Visible = xlVeryHidden
Next
Sheets("Dashboard").Visible = True
End Sub

That will hide all the sheets except "Dashboard" when you open the file. Then use the code from post #3 behind the button on each page.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,444
Messages
5,642,187
Members
417,259
Latest member
gtacw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top