Thread: inputbox
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dan E[_2_] Dan E[_2_] is offline
external usenet poster
 
Posts: 102
Default inputbox

Lawson,

Try:

If MyValue1 = "" Then Exit Sub

vbCancel won't work

Dan E

"Lawson" wrote in message ...
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