VBA code to Collapse Specific Range of grouped cells leaving other ranges expanded

0

Hi

Apologies, I am a VBA newbie and this might be a bit basic...


I am looking for some VBA code to collapse a specific range of grouped cells (row 7 on my sheet) whilst leaving other ranges of grouped cells (rows 37 to 51 on my sheet) expanded. I have tried hunting forums but can only find code to collapse all cells (somthing like ActiveSheet.Outline.ShowLevels RowLevels:=1, ColumnLevels:=1). So I have attempted using the following but to no avail:-


Rows("7:7").Outline.ShowLevels RowLevels:=1, ColumnLevels:=1



Any help would be greatly appreciated.
Thanks
Answer
Discuss

Discussion

I have managed to work it out after a bit more googling. Quite easy really:-

Rows(7).EntireRow.ShowDetail = false
JasonExcel Mar 12, '18 at 6:49 am
Add to Discussion

Answers

0

Why to "collapse" a single row using VBA? Have you considered just hiding the row?

ActiveSheet.Rows(7).Hidden = True
Discuss

Discussion

I wanted the finished models to
JasonExcel Mar 21, '18 at 9:24 am
Interesting point. Thank you for sharing.
Variatus (rep: 1328) Mar 21, '18 at 8:02 pm
Add to Discussion

Answer the Question

You must create an account to use the forum. Create an Account or Login