Results 1 to 6 of 6

Thread: messagebox to prompt another messagebox
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Aug 2017
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default messagebox to prompt another messagebox

    I am having a difficult time figuring out how to have a yes/no messagebox selection open another yes/no messagebox. Is this not possible and I need to use a userform?

  2. #2
    MrExcel MVP
    Join Date
    May 2009
    Posts
    16,492
    Post Thanks / Like
    Mentioned
    37 Post(s)
    Tagged
    8 Thread(s)

    Default Re: messagebox to prompt another messagebox

    Code:
    Sub OneMsgBxTrggersAnother()
    Dim ans As Long
    ans = MsgBox("This is the first message box, click Yes to get a second message box", vbYesNo)
    If ans = vbYes Then MsgBox "This is the second message box"
    End Sub
    Joe

    When I was a young man I knew everything. Now that I'm older, I realize I know very little, and what I do know, I tend to forget!

  3. #3
    Board Regular
    Join Date
    Aug 2017
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: messagebox to prompt another messagebox

    so this has to be in it's own sub? my original msgbox was in a Private Sub Worksheet_Change(ByVal Target As Range).
    I am just trying to have the yes selection generate an additional msgbox with another question that would result in different actions.

    Code:
     Dim MsgTitle, MsgPrompt As String, Ret As Integer
     If Not Intersect(Target, Range("B12")) Is Nothing Then
        Application.ScreenUpdating = False
        MsgPrompt = "Is this either a New Task, or a Technical Change?"
        MsgTitle = "Possible Engineering Review Required"
        If Sheet1.[B12].Value <> "" Then
            Ret = MsgBox(MsgPrompt, vbYesNo, MsgTitle)
            If Ret = vbNo Then
                Sheet8.CheckBox1.Value = True
                Sheet8.CheckBox2.Value = True
                MsgBox "verify (Review Not Required) Boxes are checked on lines 1 and 2 of SA20045 form"
                Sheet7.Visible = xlSheetVeryHidden
            Else
                MsgBox "Ensure SA20044 Form is included with deliverable"
                Sheet8.CheckBox1.Value = False
                Sheet8.CheckBox2.Value = False
                Sheet7.Visible = True
                End If
        End If
    End If

  4. #4
    Board Regular
    Join Date
    Aug 2017
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: messagebox to prompt another messagebox

    I just realized I don't think I made myself very clear. I want the first yes/no message box to have those selections trigger other yes/no msgbox.

  5. #5
    MrExcel MVP
    Join Date
    May 2009
    Posts
    16,492
    Post Thanks / Like
    Mentioned
    37 Post(s)
    Tagged
    8 Thread(s)

    Default Re: messagebox to prompt another messagebox

    No, it doesn't have to be in a separate sub - just trying to show you the logic required which you can adapt to your event code. The 2nd box can be Yes/No, too, if that's what you want.
    Joe

    When I was a young man I knew everything. Now that I'm older, I realize I know very little, and what I do know, I tend to forget!

  6. #6
    Board Regular
    Join Date
    Aug 2017
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: messagebox to prompt another messagebox

    Quote Originally Posted by JoeMo View Post
    No, it doesn't have to be in a separate sub - just trying to show you the logic required which you can adapt to your event code. The 2nd box can be Yes/No, too, if that's what you want.
    thanks.

Some videos you may like

User Tag List

Tags for this Thread

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
  •