Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple MsgBox question
I'm currently new to and studying VBA and having trouble understanding
the msgbox function. Why is it that sometimes you have to include the arguments in parentheses and other times you don't. I've noticed that when just a prompt is required, it seems that the parentheses are not required. Looked all over and haven't found an answer. Thanks, Greg |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple MsgBox question
If you are just calling MsgBox there is no need for parantheses
Msgbox myMessage,vbYesNo If you are returning the Msgbox result (the button pressed) and testing that, parentheses are needed If MsgBox(myMessage,vbYesNo) = vbYes Then ... -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Gig" wrote in message oups.com... I'm currently new to and studying VBA and having trouble understanding the msgbox function. Why is it that sometimes you have to include the arguments in parentheses and other times you don't. I've noticed that when just a prompt is required, it seems that the parentheses are not required. Looked all over and haven't found an answer. Thanks, Greg |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple MsgBox question
Just to add, that is a convention/the syntax for all functions and
subprocedures, not just for message boxes. -- Regards, Tom Ogilvy "Bob Phillips" wrote in message ... If you are just calling MsgBox there is no need for parantheses Msgbox myMessage,vbYesNo If you are returning the Msgbox result (the button pressed) and testing that, parentheses are needed If MsgBox(myMessage,vbYesNo) = vbYes Then ... -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Gig" wrote in message oups.com... I'm currently new to and studying VBA and having trouble understanding the msgbox function. Why is it that sometimes you have to include the arguments in parentheses and other times you don't. I've noticed that when just a prompt is required, it seems that the parentheses are not required. Looked all over and haven't found an answer. Thanks, Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
A simple inputbox & responding msgbox coding | Excel Discussion (Misc queries) | |||
IF formula-simple question; simple operator | Excel Discussion (Misc queries) | |||
Simple Msgbox needed | Excel Programming | |||
Simple Simple Excel usage question | Excel Discussion (Misc queries) | |||
simple question, hopefully a simple answer! | Excel Programming |