Splitting a name in vba

taShi

New member
Local time
Today, 23:48
Joined
Apr 24, 2002
Messages
8
Does anyone have any code that reads a name field that contains the name in the following format (John T Smith), picks up the Firstname, last name, and dumps them into different fields.

thx!
 
You'll need the text manipulation functions

InStr(), Len(), and Left()/Right()/Mid() are going to be your best friends on this endeavour. There are examples of how to do this in the archives, but it's a useful skill to learn in general.

David R
 
thx!!

my question really is how do you use the instr() function to read a string from the right versus the left?
 
Ummm, that's a tricky one...

Do a search on InStrRev() in the archives. Rich I believe posted it before, it's a nifty little function.
 
Last edited:
i have a code which splits any given text up into words, if you're still interested....send an email to this address and i'll reply with the attachment.

mrxdotcom@yahoo.co.uk
 

Users who are viewing this thread

Back
Top Bottom