Excel VBA Expand/Collapse with Subtotals

R

rhodyman10

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!
 
T

Tom Ogilvy

Worksheets("Sheet1").Outline _
.ShowLevels rowLevels:=3, columnLevels:=1

or

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


See help on these methods for details.
 
L

Larry D

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.
 

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