Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to delete Excel worksheet using VBA without delete dialog?
In my VBA macro, I delete a worksheet. A dialog displays asking if I really
want to delete the worksheet. The answer is always yes therefore I do not want the user to have to click the Delete button so the macro can continue. Is there any way to turn off this "feature"? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to delete Excel worksheet using VBA without delete dialog?
Hi cocalico22
You can use DisplayAlerts Sub DeleteActiveSheet() Application.DisplayAlerts = False ActiveSheet.Delete Application.DisplayAlerts = True End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "cocalico22" wrote in message ... In my VBA macro, I delete a worksheet. A dialog displays asking if I really want to delete the worksheet. The answer is always yes therefore I do not want the user to have to click the Delete button so the macro can continue. Is there any way to turn off this "feature"? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to delete Excel worksheet using VBA without delete dialog?
application.displayalerts = false
'delete the sheet code here application.displayalerts = true cocalico22 wrote: In my VBA macro, I delete a worksheet. A dialog displays asking if I really want to delete the worksheet. The answer is always yes therefore I do not want the user to have to click the Delete button so the macro can continue. Is there any way to turn off this "feature"? -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to delete Excel worksheet using VBA without delete dialog?
Application.DisplayAlerts = False
Worksheets("Sheet1").Delete Application.DisplayAlerts = True -- Charles Chickering "A good example is twice the value of good advice." "cocalico22" wrote: In my VBA macro, I delete a worksheet. A dialog displays asking if I really want to delete the worksheet. The answer is always yes therefore I do not want the user to have to click the Delete button so the macro can continue. Is there any way to turn off this "feature"? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to delete Excel worksheet using VBA without delete dialog?
put this line in front of your group of code that deletes the worksheet
Application.DisplayAlerts = False then put this after Application.DisplayAlerts = True I think that should take care of it. "cocalico22" wrote: In my VBA macro, I delete a worksheet. A dialog displays asking if I really want to delete the worksheet. The answer is always yes therefore I do not want the user to have to click the Delete button so the macro can continue. Is there any way to turn off this "feature"? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete worksheet - dialog box showing | Excel Programming | |||
changing options in delete dialog box | Excel Discussion (Misc queries) | |||
Delete a Sheet without dialog | Excel Programming | |||
Disable Worksheet Delete Dialog | Excel Programming | |||
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below | Excel Programming |