Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All
What I'm trying to do is between a range of sheets ("Reports==" and "Pivots==") ensure that the relevant columns and rows are grouped together. I've recorded the macro and that works fine, but I wanted to try and do it using a macro that wasn't recorded... Here's what I've got so far: Sub ShtsGpd2() 'ShtsGpd2 Macro 'Slightly better method of grouping sheets together based on a range, starting point etc. Dim msheetsarray As Sheets Dim sh As Worksheet Set msheetsarray = Worksheets(Array("Reports==", "Pivots==")) For Each sh In msheetsarray With sh .Outline.ShowLevels RowLevels:=0, ColumnLevels:=1 .Outline.ShowLevels RowLevels:=1 End With Next Sheets("Sheet1").Select Range("B4").Select End Sub It loops through the sheets but doesn't actually do anything! When i recorded the macro, there was an "activesheet." before the "outline" above, but the vba commander wasn't liking that... Any suggestions? Cheers |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Grouping sheets copies Header across to all sheets | Excel Worksheet Functions | |||
grouping sheets | Excel Programming | |||
Grouping Sheets | Excel Discussion (Misc queries) | |||
grouping sheets | Excel Programming | |||
Grouping Sheets in VBA | Excel Programming |