Message Box Options

  • Thread starter Thread starter James
  • Start date Start date
J

James

I have a messae box with yes and no buttons but I cannot
seem to get the code working to have different things
happening when either button is pressed.

Does anyone know the format of the code I need to put in
to acheive this?

Regards

James
 
James, It would have been helpful to know what you wanted to do if Yes or
No, and the event where you wanted to do this, but here is some generic
code:

Dim intResponse as Integer
intResponse = MsgBox("Do you wish to continue?",vbYesNo)
If intResponse = vbYes then
' Do something here if Yes!!
Else
' Do something here if not Yes!!
End If

Notice I'm using the MsgBox() function, not just a MsgBox.
 
Back
Top