Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
using variable from input box
Sub marine()
Dim s As String s = Application.InputBox(prompt:="enter LTX or EPT", Type:=2) If s = "EPT" Or s = "LTX" Then MsgBox ("Thanks") Else MsgBox ("I am leaving") End If End Sub -- Gary''s Student - gsnu200857 "Alfredo_CPA" wrote: I have this code: MyLocation = InputBox("Enter LTX or EPT", "Pick Option") If MyLocation = "" Or MyLocation < "LTX" Or MyLocation < EPT Then MsgBox "Nothing entered/Cancel or Wrong Location" Exit Sub End If Of course is not working. I need to exist sub if user puts something different than EPT or LTX (the same if user press cancel or press ok without typing anything) I think is not working becasuse the two "Or" exclude the other option (e.g. if user types LTX then Mylocation < EPT...) How can I solve this? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Variable sum from defined input | Excel Worksheet Functions | |||
Variable Input | Excel Programming | |||
Variable in one sub which refers to an input box in another sub. | Excel Programming | |||
With QUERY how to input a variable | Excel Discussion (Misc queries) | |||
Input box with variable | Excel Programming |