Delete sheet code

  • Thread starter Thread starter LiAD
  • Start date Start date
L

LiAD

Hi,

Using the VB recorder I got a code to delete a sheet that is;

Sheets("Machines").Select
ActiveWindow.SelectedSheets.delete

It runs and works. One small issue is that it asks Are you sure you want to
delete this sheet? The user must choose yes before it continues.

Can I disable the need to ask this question - once the user hits the button
it deletes, no questions?

Thanks
LiAD
 
Application.DisplayAlerts = False
Sheets("Machines").Delete
Application.DisplayAlerts = True

If this post helps click Yes
 

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

Similar Threads

Delete Worksheets 4
Suppress Delete Sheet Warning 1
Deleting sheets 3
Code inconsistent 6
Delete Worksheets in same excel 4
clear all sheets code 4
Deleting Sheets via Macro 6
If sheet exists, delete 2

Back
Top