Return Currently Displayed Outline Level

  • Struggling with what, in other posts, appears to be simple. I have columns A:K grouped. I am then running the following line of code to determine what outline level is currently being displayed.



    Code
    With Sheet1
    
    
         Test = .Columns(1).OutlineLevel
    
    
    End With


    Whether the group is expanded or not, this always returns 2. When it is collapsed it does not return 1. I have verified that columns outside of the group return a 1. I thought the fact that there are some activex controls on the worksheet might be causing problems. However I added a blank worksheet and tested the same code and received the same results. If it helps I am using MS Office Standard 2010. As usually I am sure I am missing something obvious so apologies for that. And as always any help is greatly appreciated!!

  • Re: Return Currently Displayed Outline Level


    If you just want to group and ungroup


    I have found OutlineLevel property always returns 2.

    Regards
    [SIZE=3]Anthony
    [/SIZE]&WCF_AMPERSAND[SIZE=3]
    [/SIZE]&WCF_AMPERSAND&WCF_AMPERSAND&WCF_AMPERSAND[SIZE=2]You have your way. I have my way. As for the right way, the correct way, and the only way, it does not exist.[/SIZE]




  • Re: Return Currently Displayed Outline Level


    "I am sure I am missing something obvious..." Well you proved that right :) As soon as I read your post I thought, why am I doing it like this?? Thanks a million!!!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!