#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 349
Default Grouping

Hi All,
Is it possible to group visible and hidden sheets?
If so, how?

Any info appreciated
Regards
Peter
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Grouping



Nope..

"grouping" sheets is in fact selecting multiple sheets.
a hidden sheet cannot be selected...

But you can fake it. However be very careful reselecting or
reactivating = the moment you activate a grouped sheet when the
selectedsheets collection contains a hidden sheet, the selectedsheets
collection is reset.


Sub demoPrep()
Dim lTmp
lTmp = Application.SheetsInNewWorkbook
Application.SheetsInNewWorkbook = 10
Workbooks.Add
Application.SheetsInNewWorkbook = lTmp

Worksheets(Array(2, 3, 4, 5, 6, 7, 8, 9)).Visible = False

End Sub

Sub groupEdit()

Dim alVis() As Long
Dim lAct As Long


lAct = ActiveSheet.Index
ReDim alVis(1 To Worksheets.Count)

For n = 1 To Worksheets.Count
alVis(n) = Worksheets(n).Visible
Worksheets(n).Visible = True
Next

Worksheets(lAct).Activate
Worksheets.Select

For n = 1 To Worksheets.Count
Worksheets(n).Visible = alVis(n)
Next

MsgBox ActiveWindow.SelectedSheets.Count


Range("a4").Select
Selection.Value = 4

Range("a3").Formula = "=sum(" & _
Worksheets(1).Name & ":" & _
Worksheets(Worksheets.Count).Name & "!a4)"




End Sub






--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Peter wrote :

Hi All,
Is it possible to group visible and hidden sheets?
If so, how?

Any info appreciated
Regards
Peter

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
Grouping. GEM Excel Discussion (Misc queries) 8 July 2nd 09 08:10 PM
grouping Mike 6 Excel Discussion (Misc queries) 2 October 10th 08 05:53 AM
grouping Pammy Excel Discussion (Misc queries) 1 March 29th 07 06:22 AM
Grouping Ray Excel Discussion (Misc queries) 0 March 2nd 05 04:51 PM
Grouping Lila Excel Discussion (Misc queries) 1 March 1st 05 03:33 AM


All times are GMT +1. The time now is 10:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"