Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default grouping and outliining

How can I determine if a user has applied Data, Group and Outline, Group to
any rows on a worksheet, and then if true, remove just that grouping?

Bob


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default grouping and outliining

The only way I know is by checking the .EntireRow.OutlineLevel property of
a cell in the row. If the row is part of one or more groups its OutlineLevel
will be greater than 1. You should note that the last row in a group (the
"anchor" row which shows the plus/minus box next to it) is NOT part of the
group as far as the OutlineLevel is concerned.

If you ungroup a single row from the middle of a group, you split the group
into two groups. The row you ungrouped becomes the "anchor" row for the group
above it, and the grouped rows below it become a new group (if the row is prt
of multiple groups, only the lowest-level grouping is affected). You can't
easily restore it exactly the way it was, so this seems like a pretty odd
thing to do. I generally just remove all the user's grouping on the sheet if
it is going to interfere with the processing I need to do.

Cells.Rows.Ungroup will remove one level of grouping at a time from an
entire worksheet. To be sure you have removed all the grouping you will have
to find the row with the highest OutlineLevel, then run the command above
until that row's OutlineLevel is 1. Even if you are just removing the
grouping from a single row you need to ungroup it until its OutlineLevel is 1.

Hope this helps,

Hutch

"Robert Flanagan" wrote:

How can I determine if a user has applied Data, Group and Outline, Group to
any rows on a worksheet, and then if true, remove just that grouping?

Bob


.

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 [email protected] Excel Programming 0 April 30th 07 08:12 PM
grouping Pammy Excel Discussion (Misc queries) 1 March 29th 07 06:22 AM
Grouping Geoffrey Allen Excel Worksheet Functions 1 January 16th 07 12:47 AM


All times are GMT +1. The time now is 11:25 PM.

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"