View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Hiding and Showing Sheets using Macro

hi,
very possible. i didn't write in all so you will have to do some creating on
you own, i am just showing you have to get started.
hide all sheets except 1 when you save and close the file. that way only one
sheet will be showing at open.
drop a command button on the sheet and put this code in it. it will unhide
the first five sheets and activate(select) sheet2. change if you want. this
same code can be use for your other 2 buttons except different sheet names.
Private Sub CommandButton1_Click()
Sheets("Sheet2").Visible = True
Sheets("Sheet3").Visible = True
Sheets("Sheet4").Visible = True
Sheets("Sheet5").Visible = True
Sheets("Sheet2").Activate
End Sub

code to return to sheet1 and rehide sheets 2-5... this code can be use for
all the other return/rehide buttons except... again... different sheet names.
Private Sub CommandButton2_Click()
Sheets("sheet1").Activate
Sheets("Sheet2").Visible = False
Sheets("Sheet3").Visible = False
Sheets("Sheet4").Visible = False
Sheets("Sheet5").Visible = False
End Sub

hope this helps.

Regards
FSt1

"engbe" wrote:

Hi Does any have any ideas on how to create a macro for this or if this is
possible?

- I want to have 1 workbook with about 13 spreadsheets in it.
- When I open the workbook I only want to see "sheet 1" (with the other 12
spreadsheets hidden)
- On sheet 1 i want to have 3 buttons, 1. Commodities 2. Forex 3. Options
- When I click on the 'Commodities' button, I want spreadsheets 2,3,4 & 5 to
show/be unhidden
- I also want there to be a button on spreadsheet 2,3,4,&5 to say 'Back to
Spreadsheet 1' and when clicked will navigate back to spreadsheet 1 and
spreadsheets 2,3,4 & 5 hidden again (like when i first open the workbook)
- When i click on the 'Forex' button, I want spreadsheet 6,7,8 & 9 to be
shown/unhidden
- I also want there to be a button on spreadsheet 6,7,8 & 9 to say 'Back to
Spreadsheet 1' and when clicked will navigate back to spreadsheet 1 and
spreadsheets 6,7,8 & 9 hidden again (like when i first open the workbook)
- When i click on the 'Options' button, I want spreadsheet 10,11 & 12 to be
shown/unhidden
- I also want there to be a button on spreadsheet 10,11 & 12to say 'Back to
Spreadsheet 1' and when clicked will navigate back to spreadsheet 1 and
spreadsheets 10,11 & 12hidden again (like when i first open the workbook)

I'm not sure if what i want to do is even possible and would really
appreciate any help on how to do this or on a better way to do this.

Many thanks in advance!