vbYesNo + vbquestion

piresmdb

Board Regular
Joined
Feb 3, 2011
Messages
67
Hi al

Lets Imagine that I have the follow question
Msg = "Would you like to travel"
Ans = MsgBox(msg, vbYesNo)

then in case of afirmative answer (YES) I would also like to ask another question example Europe or Asia?

How can I do it?
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Try something like this, but I think you would be better of looking to use a VBA Form

Sub msg1()
If MsgBox("Please select yes or no", vbInformation + vbYesNo, "Sample") = vbYes Then
MsgBox ("Select a country")
Else: Exit Sub

End If
End Sub




 
Last edited:
Upvote 0
Maybe like this

Code:
msg = "Would you like to travel"
ans = MsgBox(msg, vbYesNo)
If ans = vbYes Then
'
'more code
'
End If
 
Upvote 0
You mean something like this?

Code:
    msg = "Would you like to travel?"
    ans = MsgBox(msg, vbYesNo)
    If ans = vbYes Then
        msg = "To Europe or Asia?"
        ans = MsgBox(msg, vbYesNo)
        If ans = vbYes Then
            ' code if they answer yes...
        End If
    End If
 
Upvote 0

Forum statistics

Threads
1,217,896
Messages
6,139,263
Members
450,190
Latest member
BrooksProctor

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