?
Solved

"plucking" values from a string

Posted on 2003-03-07
6
Medium Priority
?
184 Views
Last Modified: 2010-05-01
I'm retrieving raw quote info from yahoo. The string looks like:

"S",19.93,"3/7/2003","1:18pm",+0.63,19.30,20.30,18.91,2973700

Anyone care to suggest a "quick % dirty" was to grab the second field?

Thanks


0
Comment
Question by:cwest1
  • 3
  • 2
6 Comments
 

Author Comment

by:cwest1
ID: 8090086
sorry for the typos. last line should be
Anyone care to suggest a "quick &dirty" way to grab the second field?
0
 
LVL 2

Expert Comment

by:keenez
ID: 8090100
use split to split the string.

x = split(str)
msgbox x(1)

The second field will element 1

Cheers,

keenez
0
 
LVL 2

Accepted Solution

by:
keenez earned 300 total points
ID: 8090107
Oops .... that should be
x = split(str, ",")
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:cwest1
ID: 8090237
but msgbox returns an out of range error!
0
 

Author Comment

by:cwest1
ID: 8090376
fixed by adding dim x. strange!
0
 

Expert Comment

by:TeleKawaru
ID: 8090457
MsgBox Mid(yahoo, InStr(1, yahoo, ",") + 1, Len(Left(yahoo, InStr(5, yahoo, ",", vbTextCompare))) - InStr(1, yahoo, ",") - 1)

Where yahoo is your string.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month8 days, 1 hour left to enroll

616 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question