VB Functon as Sub

Example of Function called as Sub:

'MsgBox function return "OK" or "cancel" to variable "retLong" retLong = MsgBox("OK to proceed", vbOKCancel)

'MsgBox function called as Sub, with no return variable MsgBox "OK to proceed?", vbOKCancel

Both of these will have the same external behavior, pausing the program to get input. Only the first allows you to see what the user selected. Long values for vbOK (=1) or vbCancel (=2) are returned to the variable "retLong" based on user selection.

Reply to
That70sTick
Loading thread data ...

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.