View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Deleting sheets removing/turning off the xl prompt

Hi
try the following
application.DisplayAlerts = False
Sheets("working").Select
ActiveWindow.SelectedSheets.Delete
application.DisplayAlerts=True


--
Regards
Frank Kabel
Frankfurt, Germany

EMMA wrote:
Hello

I'm building a macro which involves creating some new
worksheets, performing calcs in them, then deleting the
rough working worksheets before saving the amended file,
using the following code:

Sheets("working").Select
ActiveWindow.SelectedSheets.Delete


unfortunately this means that I have to keep an eye on the
computer while running the macro, as the prompt for
deleting the sheets comes up everytime. Very annoying when
the macro takes about 10 minutes to work on each file.

One alternative solution would be to move the rough
working sheets to another file and then kill that file,
but this seems a bit contrived. Is there a cleverer way of
getting around this problem, such as a command to turn off
the automatic prompt, or a different way of deleting the
sheet which won't require any manual input?

Cheers