It almost works. i see the number with the period. but also the following line.
So I get this
234.
This is my second line
Main Topics
Browse All TopicsI have the following string..it always varies in length.. Up to the ":" is consistant and the period after each line. How to extract number out of string for each line...thanks..
Have several lines. The below is an example.
This is my first line : 234.
This is my second line : 100.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Oops, in my sample code, there is an error in line ordering, should be:
Dim sample as String
Dim value as String
Dim colon as Integer
sample = "This is my first line : 234."
colon = Instr(, sample, ":")
value = val(Mid(sample, colon+1, Instr(colon, sample, ".") - colon))
the real job is made in the last 2 lines
Ok,,,I've got it... I am just repeating this for each line....changing the the inStr each time..
Thanks.
idx = InStr(s, "This is my first line :")
result = Mid(s, idx, l - idx)
colPos = (InStr(result, ":") + 1)
perPos = InStr(result, ".")
dataLen = (perPos - colPos)
result= Mid(result, colPos, dataLen)
Business Accounts
Answer for Membership
by: matthewspatrickPosted on 2008-10-09 at 10:46:26ID: 22680715
Debug.Print Trim(Split(SomeVariable, ":")(1))