Hide/unhide TAB Script

B

BvMcLaughlin

Initially I wanted to group TABs together i.e. if i clicked on a TAB
five TABs pertaining to that TAB woud show up and the others would not
be seen, but i learned through this:
http://groups.google.com/group/micr...read/thread/c515d9da1bd67df5/ac740ea26a7a5570

thread that i couldn't but one of the members named otto Moehrbach
posted this script to unhide TABs

Private Sub Worksheet_Activate()
Dim ws As Worksheet
For Each ws In Sheets(Array("One", "Two", "Three"))
ws.Visible = True
Next ws
End Sub

Now this is great but I need a little more. What I would like to do
is, well ill explain through example. Lets say I want an Excel
document with 6 TABs (A, B, C, D, E, F) but really there are 30
TABs. When I open the Excel document I would like it to open in TAB
"A" all the time and with tabs 1-12 and 1a-12a Hidden. Now 1-12 and
1a-12a should be or stay hidden when A, B, C, or D is active. Now
when I activate "E" I would like TABs 1-12 to show and TABs A - F to
hide, and the same would go for TAB "F" it would hide A - F and show
only 1a-12a. Now I'm guessing I would need some sort of "BACK" TAB
to show up in "E" and "F" so that I can get back to showing A-F and
hiding 1-12 and 1a-12a.

I hope that made sense, if you need more clarification please just
ask, I am using Excel 2002, in windows XP, thanks for any halp you can
provide.
 
O

Otto Moehrbach

What you want can be done but your explanation of what you want is a bit
confusing. You say you want tabs A:F hidden when you select tab E. That
means that tab E, the sheet you selected, would be hidden. The obvious
question is what sheet do you want active after you have hidden the active
sheet? A similar question for tab F.
Post back and present what you want in a more logical and detailed form.
Something like:
Activate tab A: This happens, that happens.
Deactivate tab A: This happens, that happens.
And so forth for every sheet in the file. HTH Otto
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top