View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Cancel Input Box error

Hi Howard,

Am Wed, 22 Oct 2014 16:43:21 -0700 (PDT) schrieb L. Howard:

With the OK and CANCEL options, I tried all the commented out exit codes for the Input Box and all produce an error on this line:

sNum = InputBox("Stock Number Required.", "Quantidade Retirada")


try the Application.InputBox

if the user presses "OK" with no entry he gets an error message in the
sheet. If he presses "Cancel" he gets a MsgBox:

sNum = Application.InputBox("Stock Number Required.", _
"Quantidade Retirada", Type:=1)

If sNum = False Then
MsgBox "You canceled"
Exit Sub
End If


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional