ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel VBA Expand/Collapse with Subtotals (https://www.excelbanter.com/excel-programming/383467-excel-vba-expand-collapse-subtotals.html)

[email protected]

Excel VBA Expand/Collapse with Subtotals
 
I am using Excel 2000 with Microsoft Windows 2000.

I created a spreadsheet with double subtotals on each of the three
tabs.
I know that when I click on the plus signs off to the left, it
collapses the subtotals
so I can see the detail.

How do I do this in code?

I just want to collapse specific numbers in my subtotals.

I have to do this many times each day manually, so the code will be a
big help!


Tom Ogilvy

Excel VBA Expand/Collapse with Subtotals
 
Worksheets("Sheet1").Outline _
.ShowLevels rowLevels:=3, columnLevels:=1

or

Worksheets("Sheet1").Rows(2).OutlineLevel = 1


See help on these methods for details.

--
Regards,
Tom Ogilvy


wrote in message
oups.com...
I am using Excel 2000 with Microsoft Windows 2000.

I created a spreadsheet with double subtotals on each of the three
tabs.
I know that when I click on the plus signs off to the left, it
collapses the subtotals
so I can see the detail.

How do I do this in code?

I just want to collapse specific numbers in my subtotals.

I have to do this many times each day manually, so the code will be a
big help!




Larry D[_2_]

Excel VBA Expand/Collapse with Subtotals
 
Tom:

Could you please give me an example how to do this for a cell in
column a with the value "11 Total", so it would expand that group's
subtotals, so it just shows all the values in column c with "total" as
part of a value?

The amount of rows vary days to day, so the column with the total I am
looking for
will probably not be in the same cell each time.

Right now I am searching all the cells in column A, finding the
specific number I want, then
I search on column c for the corresponding cells with "total" in them
and unhide
those lines only. This can be very slow.


On Feb 18, 4:02 pm, "Tom Ogilvy" wrote:
Worksheets("Sheet1").Outline _
.ShowLevels rowLevels:=3, columnLevels:=1

or

Worksheets("Sheet1").Rows(2).OutlineLevel = 1

See help on these methods for details.

--
Regards,
Tom Ogilvy

wrote in message

oups.com...

I am using Excel 2000 with Microsoft Windows 2000.


I created a spreadsheet with double subtotals on each of the three
tabs.
I know that when I click on the plus signs off to the left, it
collapses the subtotals
so I can see the detail.


How do I do this in code?


I just want to collapse specific numbers in my subtotals.


I have to do this many times each day manually, so the code will be a
big help!





All times are GMT +1. The time now is 07:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com