Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Deleting worksheets in a macro
I have a macro that at the end there are 2 work sheets that I delete.
When the macro runs, it stops and asks if I really want to delete the worksheets. Is there something I can add so that it will not ask me if I want to delete? Here is what I have. Sheets("Sheet3").Select ActiveWindow.SelectedSheets.Delete Sheets("Sheet2").Select ActiveWindow.SelectedSheets.Delete Thanks Donna |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Deleting worksheets in a macro
Have a look in the below link for details and I hope that you will get some
idea. http://www.microsoft.com/office/comm...1-898dc1f0d288 -------------------- (Ms-Exl-Learner) -------------------- "Donna" wrote: I have a macro that at the end there are 2 work sheets that I delete. When the macro runs, it stops and asks if I really want to delete the worksheets. Is there something I can add so that it will not ask me if I want to delete? Here is what I have. Sheets("Sheet3").Select ActiveWindow.SelectedSheets.Delete Sheets("Sheet2").Select ActiveWindow.SelectedSheets.Delete Thanks Donna |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Deleting worksheets in a macro
Further you dont need to select the sheets; instead you could try
Application.DisplayAlerts = False Worksheets(Array("Sheet2","Sheet3")).Delete Application.DisplayAlerts = True -- Jacob "Donna" wrote: I have a macro that at the end there are 2 work sheets that I delete. When the macro runs, it stops and asks if I really want to delete the worksheets. Is there something I can add so that it will not ask me if I want to delete? Here is what I have. Sheets("Sheet3").Select ActiveWindow.SelectedSheets.Delete Sheets("Sheet2").Select ActiveWindow.SelectedSheets.Delete Thanks Donna |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro for Deleting Worksheets | Excel Discussion (Misc queries) | |||
Deleting worksheets | Excel Discussion (Misc queries) | |||
Deleting blank worksheets | Excel Worksheet Functions | |||
Prompt before deleting worksheets? | Excel Discussion (Misc queries) | |||
Help deleting worksheets | Excel Discussion (Misc queries) |