Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Answer a msgbox yesno with a macro?

  1. #11
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Rob
    No offense, maybe I'm dense, but I saw your related post yesterday and along with this post I cannot get the big picture of the flow/logic of your code. It sound like a very simple problem to solve...
    Maybe attack from another direction?
    Tom

  2. #12
    Board Regular
    Join Date
    Feb 2002
    Location
    Huntington Beach, CA USA
    Posts
    327
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I don't know if this will help you or not:

    Private Sub Workbook_BeforeClose(Cancel As Boolean)

    Dim Msg As String, Ans As String
    If Not Me.Saved Then
    Msg = "Do you want to save the changes to"
    Msg = Msg & Me.Name & "?"
    Ans = MsgBox(Msg, vbQuestion +vbYesNo)

    Select Case Ans

    Case vbYes
    Me.Save

    Case vbNo
    Me.Saved = True
    Exit Sub
    End Select
    End If
    End Sub

    James

  3. #13
    Board Regular
    Join Date
    Feb 2002
    Location
    Stockton, California
    Posts
    281
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Qroozn,

    I could do what you suggest, but then i the code would still run through the Before_close code, thus creating errors.

    TSTom, would you mind taking a look at my workbook? I've been trying quite a few different approaches, then when i solve one thing, another problem arrises


    I appreciate the help though guys

  4. #14
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Go ahead and send it.
    Am at work so I don't have the one youe sent before
    Tom

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
  •