Pookiemeister
Well-known Member
- Joined
- Jan 6, 2012
- Messages
- 626
- Office Version
- 365
- 2010
- Platform
- Windows
When I click on the cancel button within the inputbox it gets stuck in the loop. How can I exit sub when cancel is clicked. Thank you.
Code:
Sub splitLot()
answ = ""
ans = MsgBox("Is this a split lot?", vbYesNo + vbDefaultButton1, "Split Lot")
If ans = vbNo Then
frmPackageYield.Show vbModeless
Else
Call InptBx1
If answ = "" Then
Do
MsgBox "Please enter a numerical value." & vbCrLf & "Number must be greater than one.", vbInformation + vbOKOnly, "No Value Entered"
Call InptBx1
Loop Until answ <> ""
End If
frmPackageYield.Show vbModeless
End If
End Sub
Sub InptBx1()
answ = InputBox("How many times does this lot split?", "Split Lot")
End Sub