MsgBox YesNoCancel Question

jazzscreamer

Registered User.
Local time
Yesterday, 19:12
Joined
Mar 27, 2004
Messages
31
Hi,
I'm using a YesNoCancel message box. A skeleton of how I'm using it looks like this:

If msgBox = Yes Then
.....
ElseIf msgBox = No Then
.....
End If

The problem is that this displays my message twice. How do I do this without displaying the message twice. Thank you in advance.
Joel
 
Try:

if vbNo = msgbox("User prompt",VBYesNo) then
'whatever happens on no
else
'yes has occurred
end if
 
Hi,
Thanks for your response. This would work if it was only a YesNo message box. However, it is a YesNoCancel message box. This means I need to have an If, ElseIf, Else statement. Again thank you for your response.
Joel
 
Hi,
After sleeping on it overnight I came up with the solution today. Thank you.
Joel
 
Just so everyone else knows how to do it:

Select Case MsgBox("User prompt", vbYesNoCancel)
Case vbYes
'Code omitted
Case vbNo
'Code omitted
Case Else
'Code omitted
End Select
 
Good morning "gseach"

Your post helped me here in 2011.

Many thanks.
 

Users who are viewing this thread

Back
Top Bottom