Hi,
I have an Input Box to select a case based on the user input of option 1 or 2. All works fine but I want to be able to utilise the cancel button as at the moment it does nothing at all. Is there a way I can adjust the below code to exit the sub if the cancel button is pressed?
Dim Prompt As String
Dim UserResp As String
Dim UR As Integer
Prompt = "1. Depot List" & vbCrLf
Prompt = Prompt & "2. Account List"
UR = 0
While UR < 1 Or UR > 2
UserResp = InputBox(Prompt, "Would you like to run the ZT60 by Depot List or Account List?")
UR = Val(UserResp)
Wend
Select Case UR
Thanks,
Marc
I have an Input Box to select a case based on the user input of option 1 or 2. All works fine but I want to be able to utilise the cancel button as at the moment it does nothing at all. Is there a way I can adjust the below code to exit the sub if the cancel button is pressed?
Dim Prompt As String
Dim UserResp As String
Dim UR As Integer
Prompt = "1. Depot List" & vbCrLf
Prompt = Prompt & "2. Account List"
UR = 0
While UR < 1 Or UR > 2
UserResp = InputBox(Prompt, "Would you like to run the ZT60 by Depot List or Account List?")
UR = Val(UserResp)
Wend
Select Case UR
Thanks,
Marc