Think you have to loop through the rows and check the outlinelevel property.
Find the largest one.
--
Regards,
Tom Ogilvy
"Jamie Richards" <(E-Mail Removed)> wrote in message
news:B62BF46C-50FA-40A6-A39B-(E-Mail Removed)...
> Hi Folks,
>
> Does anyone know if it possible to count the number of levels in an Excel
> worksheet outline using code? For example in the same way you may count
> rows
> using "ActiveSheet.UsedRange.Rows.Count".
>
> I want to use this feature to assist with showing and hiding grouped rows
> in
> a protected worksheet.
>
> TIA!
>
> Jamie
|