A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Excel grouped data



 
 
Thread Tools Display Modes
  #1  
Old November 15th, 2009, 04:31 PM posted to microsoft.public.excel.misc
Grey Old Man
external usenet poster
 
Posts: 1
Default Excel grouped data

I am using an Excel 2002 spreadsheet with 20+ worksheets that all contain
grouped data. Can anyone help with a macro that will automatically expand the
grouped data in each of the worksheets, and go to the last cell.

Similarly a macro is required to collapse the grouped data in each of the
worksheets, and go to the home cell.
  #2  
Old November 16th, 2009, 05:33 AM posted to microsoft.public.excel.misc
om
external usenet poster
 
Posts: 23
Default Excel grouped data

If your data has 4 levels of grouped rows then you can use;

Sub Collapse()
ActiveSheet.Outline.ShowLevels RowLevels:=4
ActiveSheet.Outline.ShowLevels RowLevels:=3
ActiveSheet.Outline.ShowLevels RowLevels:=2
ActiveSheet.Outline.ShowLevels RowLevels:=1
End Sub
Sub Expand()
ActiveSheet.Outline.ShowLevels RowLevels:=1
ActiveSheet.Outline.ShowLevels RowLevels:=2
ActiveSheet.Outline.ShowLevels RowLevels:=3
ActiveSheet.Outline.ShowLevels RowLevels:=4
End Sub

"Grey Old Man" wrote:

I am using an Excel 2002 spreadsheet with 20+ worksheets that all contain
grouped data. Can anyone help with a macro that will automatically expand the
grouped data in each of the worksheets, and go to the last cell.

Similarly a macro is required to collapse the grouped data in each of the
worksheets, and go to the home cell.

  #3  
Old November 17th, 2009, 05:23 AM posted to microsoft.public.excel.misc
Grey Old Man[_2_]
external usenet poster
 
Posts: 28
Default Excel grouped data

Thanks, this would be OK for a single worksheet, but what I am really looking
for is a macro to expand a variable number of groups (both rows and columns)
for a variable number of worksheets. A similar macro is also required to
collapse the groups after they have been used.

"om" wrote:

If your data has 4 levels of grouped rows then you can use;

Sub Collapse()
ActiveSheet.Outline.ShowLevels RowLevels:=4
ActiveSheet.Outline.ShowLevels RowLevels:=3
ActiveSheet.Outline.ShowLevels RowLevels:=2
ActiveSheet.Outline.ShowLevels RowLevels:=1
End Sub
Sub Expand()
ActiveSheet.Outline.ShowLevels RowLevels:=1
ActiveSheet.Outline.ShowLevels RowLevels:=2
ActiveSheet.Outline.ShowLevels RowLevels:=3
ActiveSheet.Outline.ShowLevels RowLevels:=4
End Sub

"Grey Old Man" wrote:

I am using an Excel 2002 spreadsheet with 20+ worksheets that all contain
grouped data. Can anyone help with a macro that will automatically expand the
grouped data in each of the worksheets, and go to the last cell.

Similarly a macro is required to collapse the grouped data in each of the
worksheets, and go to the home cell.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:35 PM.


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