inputbox

  • Thread starter Thread starter Lawson
  • Start date Start date
L

Lawson

who do i get the sub to not continue if the cancel button
is hit?

Do 'loop until proper number
entered
Check = True

If Range("d15") = "" Then
MyValue1 = InputBox(Message1, Title1, Default)
Range("m45") = MyValue1
End If

If MyValue1 = vbCancel Then ???? 'want it to end here :)

If Not (MyValue1 >= 0 And MyValue1 < 50) Then
MyValue1 = 7
Range("m45") = MyValue1
MyValue3 = MsgBox("Enter value between 0 and 50",
vbOKOnly, "Invalid Number Entered")
Else
Check = False
If Range("d15") = "" Then MyValue2 = MsgBox(Message2,
Style, Title2)
End If

Loop Until Check = False
 
Back
Top