nth element extract

R

RSCARLISLE

How do I extract the nth element of a string that contains no separators? I
can find plenty of VB routines doing this, however all of them require some
sort of separator. I want to be able to take a 10 to 15 digit alphanumeric
string and identify each character position and read the charater in that
position (including using * as a wild card).
 
J

John Bundy

not sure what you are trying to do, get something in the 7th position
everytime? or do you want to know the location of a certain character? the
first would be
=MID(B1,7,1)
The second would be
=FIND(A1,B1)
A1 containing what you are looking for, B1 what you are looking in this will
only show the first location found.
If neither of these then please be more specific.
 
A

aidan.heritage

How do I extract the nth element of a string that contains no separators? I
can find plenty of VB routines doing this, however all of them require some
sort of separator. I want to be able to take a 10 to 15 digit alphanumeric
string and identify each character position and read the charater in that
position (including using * as a wild card).

the MID function would do this, although I'm not sure what you are
getting at with the * as wild card

for instance

dim MyStr as string
MyStr="test example"
dim looper as long
for looper=1 to len(mystr)
msgbox mid(mystr,looper,1)
next


will display one character at a time from the MyStr string
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top