Help! Excel Macro Delete function!!

  • Thread starter Thread starter wmcray
  • Start date Start date
W

wmcray

I use the following command in the Excel Macro to delete an Exce
worksheet called "Report":

Sheets("Report").Delete

However when I run the macro, the user will be prompted if th
worksheet "Report" should be deleted.

I do not want user to be asked. Instead I want the worksheet "Report
to be deleted automatically.

Can anyone please advise if there is a command to "force" delete th
worksheet without asking the confirmation from user?

Million Thank
 
I do not want user to be asked. Instead I want the worksheet "Report"
to be deleted automatically.

Can anyone please advise if there is a command to "force" delete the
worksheet without asking the confirmation from user?

Application.DisplayAlerts = False
Worksheets("Report").Delete
Application.DisplayAlerts = True
HTH,
Merjet
 
wmcray said:
I use the following command in the Excel Macro to delete an Excel
worksheet called "Report":

Sheets("Report").Delete

However when I run the macro, the user will be prompted if the
worksheet "Report" should be deleted.

I do not want user to be asked. Instead I want the worksheet "Report"
to be deleted automatically.

Can anyone please advise if there is a command to "force" delete the
worksheet without asking the confirmation from user?

Million Thanks

Start every macro with

With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
.DisplayAlerts = False
End With

and end with

With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
.DisplayAlerts = True
End With

--
Amedee Van Gasse using XanaNews 1.16.3.1
If it has an "X" in the name, it must be Linux?
Please don't thank me in advance. Thank me afterwards if it works or
hit me in the face if it doesn't. ;-)

PS: I found 2 small shortcomings on www.excelforum.com:
1. You do *not* have to pay for access to 2. A *real* newsreader (not Outlook Express) is actually very easy to
use. See www.newsreaders.com for more info.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top