PDA

View Full Version : Solved: Select Case



vzachin
10-02-2006, 09:22 AM
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


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


thanks
zach

Norie
10-02-2006, 10:37 AM
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.

mdmackillop
10-02-2006, 12:56 PM
I think the Match function may be the way to go.

vzachin
10-02-2006, 05:40 PM
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

Norie
10-03-2006, 02:44 AM
zach

I think we need more information.

What exactly are you doing?

How are you 'querying' the mainframe?

How are you getting user input?

Zack Barresse
10-03-2006, 10:21 AM
.. and most importantly, what is the scope/purpose of this? Tell us what you're trying to accomplish in the end.

patrickab
10-05-2006, 10:17 AM
Perhaps something along these lines might help:



http://www.asdy88.dsl.pipex.com/Experts%20Exchange/USAStates.xls (http://www.asdy88.dsl.pipex.com/Experts%20Exchange/USAStates.xls)

vzachin
10-10-2006, 06:33 AM
thanks patrick for the coding; it's back to the drawing board with this one