From: Donna on 28 Jan 2010 21:37 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
From: Ms-Exl-Learner on 28 Jan 2010 21:43 Have a look in the below link for details and I hope that you will get some idea. http://www.microsoft.com/office/community/en-us/default.mspx?&query=Ms-Exl-Learner+Delete+Worksheet&lang=en&cr=US&guid=&sloc=en-us&dg=microsoft.public.excel.misc&p=1&tid=ceb64108-d6e8-4940-b4b1-898dc1f0d288&mid=ceb64108-d6e8-4940-b4b1-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
From: Jacob Skaria on 28 Jan 2010 23:58 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
|
Pages: 1 Prev: Vlookup, sumproduct, if, sumif... erggg! Next: pivot table calculated field or item |