InputBox buttons
The constants returned by a message box are numeric values, not strings. Try
something similar to the code below to capture the click to a variable named
intOK
dim intOK as Integer
intOK = MsgBox("Yada, yada, yada...",vbQuestion+vbOkCancel,"Title Goes Here")
More code here based upon response...
Go to the VBE (Alt + F11) and in the Help Question Box type "Intrinsic
Constants" sans quotes. Then select MsgBox constants from the result list to
see a full list of message box buttons and their return values.
--
Kevin Backmann
"Karen53" wrote:
Hi,
How do I capture the OK or Cancel button on an input box?
I've tried this but I get a type mismatch error...
Dim NewHeader as String
If NewHeader = vbOK Then 'if input box was not cancelled
--
Thanks for your help.
Karen53
|