extracting the n-th element of a string

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

Guest

would like to extract all of these elements:

int.de.sh.k.wand

Left([string],InStr([string],".")-1) gives "int"

would like to be able to separate out de, sh, k, and wand as well.

InstrRev?

Any suggestions?

Thank you.
 
Use the Split function, indicating the period as the delimiter. This will
split it at every period. See also the VBA help on the Split function.

=Split(Field1,".")(0) ' part1
=Split(Field1,".")(1) 'part2
=Split(Field1,".")(2) 'part3
=Split(Field1,".")(3) 'part4
=Split(Field1,".")(4) 'part5
 

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

Back
Top