Delete sheet code

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
 
J

Jacob Skaria

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

Top