M
mjack003
Hi,
I have a macro which prompts the user for a number and moves on. Th
problem is it continuously loops until you hit "OK". The cancel butto
does not work and instead just reloads the prompt window. How would
go about exiting the loop in the following code?
Do
mystr = InputBox(prompt:="Enter Shipping Document Number:")
If Trim(mystr) = "" Then
End If
If IsNumeric(mystr) Then
If Val(mystr) = CLng(mystr) _
And Val(mystr) < 999999 Then
mystr = Format(Val(mystr), "000000")
Exit Do
End If
End If
Loop
Any suggestions would be great.
Best Regards,
Mjac
I have a macro which prompts the user for a number and moves on. Th
problem is it continuously loops until you hit "OK". The cancel butto
does not work and instead just reloads the prompt window. How would
go about exiting the loop in the following code?
Do
mystr = InputBox(prompt:="Enter Shipping Document Number:")
If Trim(mystr) = "" Then
End If
If IsNumeric(mystr) Then
If Val(mystr) = CLng(mystr) _
And Val(mystr) < 999999 Then
mystr = Format(Val(mystr), "000000")
Exit Do
End If
End If
Loop
Any suggestions would be great.
Best Regards,
Mjac