Disabling Worksheet Delete Prompt/Worksheet Save

Lisa

Board Regular
Joined
Apr 28, 2002
Messages
80
I have a couple of questions this morning and would greatly appreciate any help.
1) The following code gives the user prompt "are you sure..blah,blah". Is there a way to disable that prompt so my users don't have to respond?
Sub Delete_Bad_Sheets()
Sheets("input").Delete
Sheets("Information").Delete
Sheets("1st pass").Delete
Sheets("Detail 1").Delete
Sheets("GLAdmin").Delete
End Sub
2)I've utilized code from the archives to save the file using cell contents... I'm getting an error. I looked at this a lot last night and can't figure out what's wrong. Any suggestions?
Sub saveme()
ActiveWorkbook.SaveAs Filename:="G:POL_ADMINPolicy Value ResearchT-Recs Detail for Apr-02 recs" & Format(Sheets("Detail").Range("a1"), "0") & ".xls"
End Sub

Thanks for any help. Can't wait til I can help answer instead of always asking. BTW, on this board, should I post each question individually? Always like to follow the rules....


Lisa
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
On 2002-05-02 04:43, Lisa wrote:
I have a couple of questions this morning and would greatly appreciate any help.
1) The following code gives the user prompt "are you sure..blah,blah". Is there a way to disable that prompt so my users don't have to respond?
Sub Delete_Bad_Sheets()
Sheets("input").Delete
Sheets("Information").Delete
Sheets("1st pass").Delete
Sheets("Detail 1").Delete
Sheets("GLAdmin").Delete
End Sub
2)I've utilized code from the archives to save the file using cell contents... I'm getting an error. I looked at this a lot last night and can't figure out what's wrong. Any suggestions?
Sub saveme()
ActiveWorkbook.SaveAs Filename:="G:POL_ADMINPolicy Value ResearchT-Recs Detail for Apr-02 recs" & Format(Sheets("Detail").Range("a1"), "0") & ".xls"
End Sub

Thanks for any help. Can't wait til I can help answer instead of always asking. BTW, on this board, should I post each question individually? Always like to follow the rules....


Lisa

1)

Sub Delete_Bad_Sheets()
Application.DisplayAlerts=false
Sheets("input").Delete
Sheets("Information").Delete
Sheets("1st pass").Delete
Sheets("Detail 1").Delete
Sheets("GLAdmin").Delete
Application.displayalerts=True
End Sub

2) What Error are you getting
 
Upvote 0
Ivan -

Your answer to #1 works great! Thanks.

I have an issue with #2 that happens before the actual save routine. Couldn't see that last night! Basically that cell is referencing one of the sheets I delete. Duh!!

Thanks again
Lisa
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top