Delete Sheet without the confirmation

LoriD

Board Regular
Joined
Apr 1, 2002
Messages
148
I have recorded a macro that I want to run and delete Sheet1 when complete. I am getting the "Are you sure you eant to delete?" message which I have to confirm with Yes or No.
Is there some code I can insert into this macro so that message doesn't pop up, or is invisible to the user?
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Try this:

Application.DisplayAlerts = False
Worksheets("Sheet1").Delete
Application.DisplayAlters = True

HTH,

Russell
 
Upvote 0

Forum statistics

Threads
1,214,403
Messages
6,119,309
Members
448,886
Latest member
GBCTeacher

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top