Forum Discussion

Lorenzo Kim's avatar
Lorenzo Kim
Bronze Contributor
Jun 18, 2018

vba to suppress subtotal prompt

When I used DATA>subtotal to remove all , a prompt  (see below) always appears, can I suppress it with vba to default as OK so that it will not show?

many thanks

 

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor
    I would suggest to solve the issue itself. Make sure the columns with your subtotalled data have one row with heading information. Each column must have a unique column name in one single cell. To force Excel to recognize it is a header, format the header differntly from the remaining rows, e.g. by setting the font to Bold.
    • Lorenzo Kim's avatar
      Lorenzo Kim
      Bronze Contributor
      Mr Pieterse
      Thank you for your suggestion.
      many thanks
    • Lorenzo Kim's avatar
      Lorenzo Kim
      Bronze Contributor

      I found an article to suppress prompt by using:

      Application.DisplayAlerts = False

      then revert it to True afterwards.

      This of course should only be done if all issues have been addressed.

      thanks

      • JKPieterse's avatar
        JKPieterse
        Silver Contributor
        I agree, this is a catch-all approach which is not the best way to address the above issue. It *is* useful in some other cases however.

Resources