-
Solved: Select Case
hi,
i have the following code which works fine the way it is.
the data is referenced on a sheet A5:A62. Is there a way to reference this?
I tried Case Range ("A5:A62") but that didn't work
[vba]
For x = 9 To 17
Select Case Sess0.Screen.GetString(x, 4, 2)
Case "NEW YORK", "NEW JERSEY", "RHODE ISLAND", "VIRGINIA", _
"WEST VIRGINIA", "CALIFORNIA", "ALASKA", "ARKANSAS"
If ...
End if
end select
next x
[/vba]
thanks
zach
-
zach
If you mean that A5:A62 contains New York etc the answer is no.
Are you actually sure Select Case is the best way to do this?
You only appear to have one Case statement.
-
I think the Match function may be the way to go.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
-
hi,
i want my end user to have the flexibility to input the states for querying the mainframe.
the way i have it set up now, i would need to change the coding each time. so i thought that maybe i can have the user input the states that they want and i can have the code reference that range.
i guess Select Case might not be the way to go then.
could i use the match function for this? how would i do this?
zach
-
zach
I think we need more information.
What exactly are you doing?
How are you 'querying' the mainframe?
How are you getting user input?
-
.. and most importantly, what is the scope/purpose of this? Tell us what you're trying to accomplish in the end.
-
Last edited by mvidas; 10-05-2006 at 11:53 AM.
Reason: fixed hyperlink
-
thanks patrick for the coding; it's back to the drawing board with this one
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules