Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding details for groups using VBA 1

Status
Not open for further replies.

OzzieOwl

Technical User
Dec 13, 2001
45
GB
I have written a macro that use the grouping feature of excel, however I want to hide the details of each group within the macro, so the finished sheet shows just the summaries, and the user has the option to show the details.
Any help greatfully received. I have tried recording a macro, but it when I look at the macro there is nothing there.

Cheers

Martin


 
I am actually having major issues with grouping things right now too, but in my travels I found this answer to your question...

From the Help files...
Using the Outline Object

Use the Outline property to return an Outline object. The following example sets the outline on Sheet4 so that only the first outline level is shown.

Worksheets("sheet4").Outline.ShowLevels 1

Now, Martin (or anybody else!), Can I ask you... How the heck did you achieve getting rows grouped in the first place? I cannot work out the syntax. Anybody know what I have done wrong here?
myRange.Group(nRowNumber,nRowNumber+ i).Select
Selection.Rows.Group

I may be completely off... Please help me out!

Thanks!
 
Hi fliss

Thanx for your help, that works brilliantly.

In answer to your question, I built a loop to detect where the start and end of the goups where, then used the following syntax

Rows(groupstart & ":" & groupend).Select
Selection.Rows.group

It doesn't seem to be that different from what you are doing.

Hope this helps

Martin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top