Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Variable sum from defined input David Excel Worksheet Functions 7 March 10th 09 06:26 AM
Variable Input ryguy7272 Excel Programming 13 May 9th 08 11:44 PM
Variable in one sub which refers to an input box in another sub. Aaron Excel Programming 1 July 1st 07 08:36 PM
With QUERY how to input a variable Guillaume Excel Discussion (Misc queries) 1 December 8th 05 02:28 PM
Input box with variable buggy Excel Programming 2 November 19th 04 03:11 PM


All times are GMT +1. The time now is 11:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"