Delete a sheet

  • Thread starter Thread starter Newbie
  • Start date Start date
N

Newbie

Hi
I want to be able to delete a sheet - how can I stop the system confirmation
message appearing.

In access I use docmd.setwarnings = false - is there something similar for
Excel

Thanks
 
Try something like

Application.DisplayAlerts = False
' delete the sheet
Application.DisplayAlerts = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
thanks - works a treat!

Chip Pearson said:
Try something like

Application.DisplayAlerts = False
' delete the sheet
Application.DisplayAlerts = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Don't know if it would be of interest since you are already
working with a macro of your own.

I have a macro that I invoke from the toolbar to delete
the active sheet under certain conditions.

If there is code associated with the sheet -- don't delete
and exit the macro.

If the sheetname begins with "Sheet" then delete without warning.
Otherwise, let the standard dialog come up with warning.

Keeps me out of trouble when I go through all the worksheets
quickly. I use toolbar buttons to do that but you can go through
the worksheets with Ctrl+PageUp or Ctrl+PageDown.


Chip Pearson said:
Application.DisplayAlerts = False
' delete the sheet
Application.DisplayAlerts = True

Newbie said:
I want to be able to delete a sheet - how can I stop the system
confirmation message [from] appearing.
 

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

Back
Top