nth element extract

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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).
 
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.
 
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
 
Back
Top