View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
L. Howard L. Howard is offline
external usenet poster
 
Posts: 852
Default Cancel Input Box error

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")

Otherwise the box and code work okay.

Howard


myIB2:
sNum = InputBox("Stock Number Required.", "Quantidade Retirada")
' If sNum = vbNullString Then
' MsgBox ("User canceled!")
' End If
'If sNum = vbNullString Then Exit Sub
'If sNum = "" Then Exit Sub
'If sNum = 0 Then Exit Sub

If sNum rngFnd.Offset(, 6) Then
MsgBox "Stock Actual is: " & rngFnd.Offset(, 6) & _
" You are requesting: " & sNum & vbCr & vbCr & _
" Stock Minimo is: " & rngFnd.Offset(, 5)

Sheets("Saídas").Range("F10").ClearContents
GoTo myIB2
'Exit Sub
Else
'/ Continue code
Sheets("Saídas").Range("F10") = sNum
rngFnd.Offset(, 6) = rngFnd.Offset(, 6) - sNum
rngFnd.Offset(, 6).Copy Sheets("Saídas").Range("J10")
End If