Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
another macro query - deleting a worksheet within a query
I've got the following code in a macro to delete a worksheet within a
spreadsheet i've devised. Sheets("Lookup tables").Select ActiveWindow.SelectedSheets.Delete When run, the macro (which is part of a larger macro) requests the user to confirm the deletion of the worksheet. Is there a piece of code I can enter to avoid this msg box appearing. I would like the macro to automatically delete the worksheet and not ask for confirmation to do so. Many thanks, David Hawes |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
another macro query - deleting a worksheet within a query
This should do the trick
Sub deleteit() Application.DisplayAlerts = False Sheets("sheet1").Select ActiveWindow.SelectedSheets.Delete Application.DisplayAlerts = True End Sub "DavidHawes" wrote: I've got the following code in a macro to delete a worksheet within a spreadsheet i've devised. Sheets("Lookup tables").Select ActiveWindow.SelectedSheets.Delete When run, the macro (which is part of a larger macro) requests the user to confirm the deletion of the worksheet. Is there a piece of code I can enter to avoid this msg box appearing. I would like the macro to automatically delete the worksheet and not ask for confirmation to do so. Many thanks, David Hawes |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
another macro query - deleting a worksheet within a query
Many thanks - a handy piece of code to know as well.
Thanks again. "Mike" wrote: This should do the trick Sub deleteit() Application.DisplayAlerts = False Sheets("sheet1").Select ActiveWindow.SelectedSheets.Delete Application.DisplayAlerts = True End Sub "DavidHawes" wrote: I've got the following code in a macro to delete a worksheet within a spreadsheet i've devised. Sheets("Lookup tables").Select ActiveWindow.SelectedSheets.Delete When run, the macro (which is part of a larger macro) requests the user to confirm the deletion of the worksheet. Is there a piece of code I can enter to avoid this msg box appearing. I would like the macro to automatically delete the worksheet and not ask for confirmation to do so. Many thanks, David Hawes |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Importing Data via Web Query - Can values be passed to query? | Excel Discussion (Misc queries) | |||
Save data retreived from query without saving query | Excel Discussion (Misc queries) | |||
Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook? | Excel Discussion (Misc queries) | |||
Microsoft Query rejects "nz" function in Access Query | Excel Discussion (Misc queries) | |||
How to use a Access Query that as a parameter into Excel database query | Excel Discussion (Misc queries) |