LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Grouping a range of sheets

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
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 sheets copies Header across to all sheets James Trujillo[_2_] Excel Worksheet Functions 1 December 7th 09 08:16 PM
grouping sheets wildauk Excel Programming 6 August 29th 06 11:46 PM
Grouping Sheets keith Excel Discussion (Misc queries) 2 October 13th 05 06:00 PM
grouping sheets Hans Excel Programming 5 April 28th 04 01:23 PM
Grouping Sheets in VBA John Pierce Excel Programming 0 January 15th 04 01:06 AM


All times are GMT +1. The time now is 03:42 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"