Check for & remove Subtotal(s)

J

josnah

Currently I'm using a msgbox to ask users to manually remove subtotals
before proceeding.

If MsgBox("Pls ensure that subtotals, if any, are removed before
proceeding", vbOKCancel) = vbCancel Then Exit Sub

How can I include in my macro to first check if there is a subtotal(s)
& to remove all?
Or maybe stop the macro if there are subtotals found in the worksheet?
:confused:

Any help is greatly appreciated!
 
T

Tom Ogilvy

It wouldn't be definitive, but you could use
ActiveWindow.DisplayOutline

to see if the outline symbols are displayed.

If the data normally would not have formulas in it you could also check for
a subtotal formula using Find or use specialcells to find cells with
formulas.
 

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