Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
msgbox
Hi
Why does this not work? MsgBox("message", vbYesNo, "title") If I do this it does a = MsgBox("message", vbYesNo, "title") Why do I need to assign the result to a variable? Thanks Jo |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
msgbox
Jo
just remove the brackets ... MsgBox "message", vbYesNo, "title" Regards Trevor "Jo" wrote in message ... Hi Why does this not work? MsgBox("message", vbYesNo, "title") If I do this it does a = MsgBox("message", vbYesNo, "title") Why do I need to assign the result to a variable? Thanks Jo |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
msgbox
Hi
try MsgBox "message", vbYesNo, "title" -- Regards Frank Kabel Frankfurt, Germany "Jo" schrieb im Newsbeitrag ... Hi Why does this not work? MsgBox("message", vbYesNo, "title") If I do this it does a = MsgBox("message", vbYesNo, "title") Why do I need to assign the result to a variable? Thanks Jo |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
msgbox
Hi Jo,
You don't have to assign the MsgBox to a variable, but the fact that you specify Yes and No buttons is giving the user a choice, and so it is reasonable to assume you are interested in that response. MsgBox is a function, which means that it returns a result. You can capture the value returned or ignore it if you want, but the syntax is different depending upon your choice. For all Functions, if you want to capture the value, it is result = Function _Call([arg1[, arge2[, arg3[, ...]]]]) If you don'r want to capture the return value, you omit the brackets Function _Call [arg1[, arge2[, arg3[, ...]]]] Thus in your case, either of the following works, although in the second case you will never know whichj button was pressed a = MsgBox("message", vbYesNo, "title") MsgBox "message", vbYesNo, "title" -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Jo" wrote in message ... Hi Why does this not work? MsgBox("message", vbYesNo, "title") If I do this it does a = MsgBox("message", vbYesNo, "title") Why do I need to assign the result to a variable? Thanks Jo |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MsgBox | Excel Discussion (Misc queries) | |||
msgbox | Excel Discussion (Misc queries) | |||
MsgBox | Excel Programming | |||
Msgbox help | Excel Programming | |||
Msgbox | Excel Programming |