Check for & remove Subtotal(s)

  • Thread starter Thread starter josnah
  • Start date Start date
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!
 
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.
 
Back
Top