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