DisplayAlerts

peterbata

New Member
Joined
Feb 20, 2016
Messages
20
Hello and thank you for taking my inquiry.

I am learning about VBA code and am wondering why when stepping through these lines of code I am not presented with a warning prompt. It executes successfully but no warning. The sheet is deleted.

Sub DeleteSpecificSheets()


Application.DisplayAlerts = False
Worksheets("sheet8").Delete
Application.DisplayAlerts = True


End Sub
 
Thanks for chiming in Fishboy. Really appreciate it. Did exactly what you suggested in a new worksheet. Exact same result. I see no pop-up alert at all. The sheet is deleted outright.
My bad, DisplayAlerts is what I had meant.

Code:
Sub TurnAlertsOn()
Application.DisplayAlerts = True
End Sub
 
Upvote 0

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
That didn't wotk either. So, I logged into a clients machine remotely and tried what I had been doing originally. It worked like a charm. Popup alert and all. They are running Excel 2013. Back to the drawing board!

Sub DeleteSpecificSheets()
Worksheets("sheet3").Delete
End Sub
 
Last edited:
Upvote 0
Update. An complete online repair of my Office 2016 suite resolved my alerts issue. I thank everyone who generously gave of their time and expertise to assist me. I consider this thread closed. Peter
 
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,680
Members
449,463
Latest member
Jojomen56

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