Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Disabling Worksheet Delete Prompt/Worksheet Save

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Location
    Indianapolis
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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

  2. #2
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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


    Kind Regards,
    Ivan F Moala From the City of Sails

  3. #3
    Board Regular
    Join Date
    Apr 2002
    Location
    Indianapolis
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •