Outline.ShowLevels

K

KaiRich

Hi all,
The code:
Worksheets("Sheet1").Outline.ShowLevels ColumnLevels:=2
Will expand or collapse grouped columns for a whole sheet,
but what code will expand or collapse only one group of
columns?

E.G. If I group Columns("E:G") and separately group Columns
("X:Z") how can I get some VB code to expand E:G without
expanding X:Z?

(I can't find anything other than this bit of code in
Excel's Help and I can't find anything by searching the
Microsoft knowledge base with this group of key words.)

Thanks in advance,
Kai Richmond
 
K

keepITcool

Sub kicDemoOutline()

Rows(2).Resize(10).OutlineLevel = 3
Rows(5).OutlineLevel = 2

With ActiveSheet.Outline
.AutomaticStyles = False
.SummaryRow = xlAbove
.SummaryColumn = xlLeft
.ShowLevels 1
End With

Rows(5).ShowDetail = True
Rows(2).ShowDetail = True
End Sub

hth :)


keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
K

KaiRich

Hi,
Thanks for that - I'll give it a go.
It's hard to believe that between last night and this
morning (Australian time) my question got pushed back to
page 6!
Thanks again,
Kai Richmond
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top