DELETING A WORKSHEET USING VB AND stopping the popup request

jdavis9

Active Member
Joined
Mar 8, 2002
Messages
337
I am using a macro to delete a worksheet.

can you prevent the popup telling you its going to delete?

activewindow.selectedsheets.delete is what I use now.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Re: DELETING A WORKSHEET USING VB AND stopping the popup req

Set DisplayAlerts to False...

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> DeleteSheet()

Application.DisplayAlerts = <SPAN style="color:#00007F">False</SPAN>

ActiveWorkbook.SelectedSheets.Delete

Application.DisplayAlerts = <SPAN style="color:#00007F">True</SPAN>

<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>

</FONT>
 
Upvote 0
Re: DELETING A WORKSHEET USING VB AND stopping the popup req

Use

Application.DisplayAlerts = False
'your code
Application.DisplayAlerts = True
 
Upvote 0

Forum statistics

Threads
1,221,709
Messages
6,161,432
Members
451,705
Latest member
Priti_190

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