View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Conan Kelly Conan Kelly is offline
external usenet poster
 
Posts: 419
Default InputBox buttons

Karen,

If I remember correctly, you can't capture the buttons from the input box.

The input box returns a string. If you click OK, then it retruns whatever
is in the textbox. If you click Cancel, it returns an empty string ""
(...or does it return FALSE...look up input box in HELP).

Then you would test the button like this:

If NewHeader = "" then
'message to user that "Cancel" was pushed
exit sub
else
'commands to work with string entered in the input box
end if

HTH,

Conan





"Karen53" wrote in message
...
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