C
Cosmic
I want to cleanly ignore the cancel of an Inputbox. I'm using a Select Case,
but don't know how to test for cancel/null from Inputbox.
How do I test for cancel button?
Select Case astring = InputBox("Enter amount for each payment: ",
"Calculate Number of Payments")
Case Is > 0
' Do some code here...
Case "" '<= This produces Error 13 Type mismatch????
'Cancel button pressed, no change
MsgBox "cancel pressed"
Case Else 'Entered illegal or negative number
MsgBox "Enter a number greater than 0 for the amount for each
payment"
End Select
but don't know how to test for cancel/null from Inputbox.
How do I test for cancel button?
Select Case astring = InputBox("Enter amount for each payment: ",
"Calculate Number of Payments")
Case Is > 0
' Do some code here...
Case "" '<= This produces Error 13 Type mismatch????
'Cancel button pressed, no change
MsgBox "cancel pressed"
Case Else 'Entered illegal or negative number
MsgBox "Enter a number greater than 0 for the amount for each
payment"
End Select