Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Grouping. | Excel Discussion (Misc queries) | |||
grouping | Excel Discussion (Misc queries) | |||
Grouping | Excel Programming | |||
grouping | Excel Discussion (Misc queries) | |||
Grouping | Excel Worksheet Functions |