Subtotals in object model?

J

Josh Sale

I have a worksheet with a data list that uses Subtotals which I
programmatically create but that users sometimes modify (e.g., they change
the page break before and after).

Under certain circumstances I need to remove the Subtotals, do some
processing and then put back the Subtotals.

I've searched around in the Excel object model looking for the
representation of an active Subtotal but not found anything. Is the
definition of an existing Subtotal available to VBA? If so, I'll save away
all of the current settings, remove the existing subtotals, do my processing
and then reinstate the Subtotals as they were before I removed them.

TIA,

josh
 
S

steve

Josh,

If you're using SubTotals from the Data menu you can record making and
deleting them. Then edit your code to get what you want...
 
J

Josh Sale

I am using the Subtotals from the Data menu.

However, recording making and deleting them doesn't tell me what I need.

In particular, I need to figure out after the fact (i.e., after the user has
modified a programmatically created Subtotal) what they did so that I can
later restore the Subtotal. For example, I create a Subtotal without page
breaks between groups and summary data below. The user changes the Subtotal
to include page breaks and have summary data above.

I need to discover the current state of the Subtotals so that I can remove
them, do some processing and then recreate them as the user last had them.
 

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