Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
KJR KJR is offline
external usenet poster
 
Posts: 2
Default CAN I GROUP TABS UNDER A "MASTERTAB" IN EXCEL WORKBOOK

CAN I GROUP TABS UNDER A "MASTERTAB" IN EXCEL WORKBOOK....HAVE MANY TABS AND
WISH TO HAVE THEM IN SEPERATE CATEGORIES...THANKS
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default CAN I GROUP TABS UNDER A "MASTERTAB" IN EXCEL WORKBOOK

Hi KJR,

Add 'Master' sheets and name them Master1, Master2 ...

In the code module behind the new Master1 sheet paste code like:

'=============
Private Sub Worksheet_Activate()
Dim sh As Worksheet 'Object
Dim arr As Variant

arr = Array("Sheet1", "Sheet2", "Sheet3") ' <<=== CHANGE

On Error GoTo XIT
With Application
.EnableEvents = False
.ScreenUpdating = False
End With

For Each sh In ThisWorkbook.Sheets
If Not sh.Name Like "Master*" Then
sh.Visible = xlSheetHidden
End If
Next sh

For Each sh In Sheets(arr)
sh.Visible = xlSheetVisible
Next sh

XIT:
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub

'--------------------------

Private Sub Worksheet_Deactivate()
Dim sh As Worksheet
Dim arr As Variant

arr = Array("Sheet1", "Sheet2", "Sheet3") ' <<=== CHANGE

On Error GoTo XIT
With Application
.EnableEvents = False
.ScreenUpdating = False
End With

For Each sh In Sheets(arr)
sh.Visible = xlSheetVisible
Next sh

XIT:
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub
'<<=============

In each of the other Master sheet code modules paste similar code, changing
the sheet names listed in the statement lines:

arr = Array("Sheet1", "Sheet2", "Sheet3") ' <<=== CHANGE

Note that this line needs to be changed in each of the two subs.

The reult of this arrangement would be that the master sheet tabs will
always be available but on;y the sheets associated with the selected master
sheet will be visible.

---
Regards,
Norman


"KJR" wrote in message
...
CAN I GROUP TABS UNDER A "MASTERTAB" IN EXCEL WORKBOOK....HAVE MANY TABS
AND
WISH TO HAVE THEM IN SEPERATE CATEGORIES...THANKS



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default CAN I GROUP TABS UNDER A "MASTERTAB" IN EXCEL WORKBOOK

Hi KJR,

I should add that this is worksheet event code and should be pasted into
the master sheets's code module (not a standard module and not the
workbook's ThisWorkbook module):

Right-click the Master sheet's tab
Select 'View Code' from the menu and paste the code.
Alt-F11 to return to Excel.


---
Regards,
Norman


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
Help displaying "Maximum" or "Minimum" if cell is max or min in a group? RussAllison Excel Discussion (Misc queries) 1 February 24th 11 02:22 AM
Can't update my workbook - Name bar shows as "[Group]" Eric_NY Excel Discussion (Misc queries) 2 July 16th 09 10:01 PM
How do i enable "Group" & "Ungroup" in a protected sheet DBLA137 Excel Discussion (Misc queries) 1 March 11th 09 12:20 AM
How do i enable "Group" & "Ungroup" in a protected sheet ruddojo Excel Discussion (Misc queries) 0 June 2nd 06 01:01 AM
Pivot table "Group and Show Details" vs. "SubTotals" pgchop Excel Programming 0 February 1st 06 07:29 AM


All times are GMT +1. The time now is 11:00 PM.

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"