View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default InputBox buttons

hi
try this
Dim r As String
r = InputBox("enter something")
If Not r = "" Then 'user clicked cancel
'do something
else
'do something else
end if

Regards
FSt1
"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