Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
how do I supress the warning when deleting a sheet with a macro? I am using
the command following command to delete the sheet. Sheets("Sheet1").Delete |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Application.DisplayAlerts = False
Sheets("Sheet1").Delete Application.DisplayAlerts = True Always set back to true as the property will stay false until reset. Bob Flanagan Macro Systems http://www.add-ins.com Productivity add-ins and downloadable books on VB macros for Excel "Sloth" wrote in message ... how do I supress the warning when deleting a sheet with a macro? I am using the command following command to delete the sheet. Sheets("Sheet1").Delete |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this:
Application.DisplayAlerts = False Sheets("Sheet1").Delete Application.DisplayAlerts = True HTH, Paul -- "Sloth" wrote in message ... how do I supress the warning when deleting a sheet with a macro? I am using the command following command to delete the sheet. Sheets("Sheet1").Delete |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On a line above the delete sheet statement put the following application
command: Application.DisplayAlerts = False Alerts in Excel are automatically reactivated when the macro is finished running so there's no need to end you macro with an "Application.DisplayAlerts = True" statement. -- Kevin Backmann "Sloth" wrote: how do I supress the warning when deleting a sheet with a macro? I am using the command following command to delete the sheet. Sheets("Sheet1").Delete |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Do you really need "Sheet1" hard-coded?
Maybe like this in case you want to delete more than one sheet. Sub SheetDelete() Application.DisplayAlerts = False ActiveWindow.SelectedSheets.Delete Application.DisplayAlerts = True End Sub Gord Dibben MS Excel MVP On Thu, 24 Jan 2008 12:53:50 -0800, Sloth wrote: how do I supress the warning when deleting a sheet with a macro? I am using the command following command to delete the sheet. Sheets("Sheet1").Delete |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Kevin, you are wrong on this one. It stays False until you turn it back to
True, even if your macro stops. Bob "Kevin B" wrote in message ... On a line above the delete sheet statement put the following application command: Application.DisplayAlerts = False Alerts in Excel are automatically reactivated when the macro is finished running so there's no need to end you macro with an "Application.DisplayAlerts = True" statement. -- Kevin Backmann "Sloth" wrote: how do I supress the warning when deleting a sheet with a macro? I am using the command following command to delete the sheet. Sheets("Sheet1").Delete |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete Sheet w/o warning prompt... | Excel Programming | |||
How to Delete Excel Sheet without Warning - MFC | Excel Programming | |||
VBA Bypass Delete Sheet Warning | Excel Programming | |||
What is the VBA code to delete a sheet without warning message? | Excel Discussion (Misc queries) | |||
Delete sheet without warning messages | Excel Programming |