ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   msgbox (https://www.excelbanter.com/excel-programming/283041-msgbox.html)

Marcus

msgbox
 
could anyone please give me an example of the correct syntax for making a msgbox with a "yesnocancel" choice of buttons - every time i think i am there i get a message asking for me to add a "=" after my close bracket and i dont know what to put in there. please help!

Marcus

Dan E[_3_]

msgbox
 
Marcus,

Post what you have when you get the message.

VB is probably looking for you to assign the result to a variable so that it
can be used later on ie:

Answer = MsgBox("Do you want to ...?", vbYesNoCancel, "... Dialog")
If Answer = vbYes Then
'Code for Yes
ElseIf Answer = vbNo Then
'Code for No
Else
'Code for Cancel
End If

Dan E


"Marcus" wrote in message ...
could anyone please give me an example of the correct syntax for making a msgbox with a "yesnocancel" choice of buttons - every

time i think i am there i get a message asking for me to add a "=" after my close bracket and i dont know what to put in there.
please help!

Marcus




Harald Staff

msgbox
 
Hi Marcus

Sub test()
Select Case MsgBox("Yo da man?", _
vbYesNoCancel + vbQuestion, "Yo")
Case vbYes
MsgBox "You da man"
Case vbNo
MsgBox "OK..."
Case vbCancel
MsgBox "Sheesh"
End Select
End Sub

--
HTH. Best wishes Harald
Followup to newsgroup only please.

"Marcus" wrote in message
...
could anyone please give me an example of the correct syntax for making a msgbox with a

"yesnocancel" choice of buttons - every time i think i am there i get a message asking for
me to add a "=" after my close bracket and i dont know what to put in there. please help!

Marcus




Trevor Shuttleworth

msgbox
 
Marcus

msgbox "Test",vbYesNoCancel

Regards

Trevor


"Marcus" wrote in message
...
could anyone please give me an example of the correct syntax for making a

msgbox with a "yesnocancel" choice of buttons - every time i think i am
there i get a message asking for me to add a "=" after my close bracket and
i dont know what to put in there. please help!

Marcus





All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com