Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on parsing a string

Status
Not open for further replies.

Sullaway

Technical User
Sep 27, 2000
50
US
Well I've read enough and followed enough examples to totally confuse
myself.

If someone would please give me an example of Parsing a string if it was to
have 3 pieces of info in the string (ie FirstName, MiddleName, and
LastName), I would really appreciate it.

TIA
Shane

 
how are these three parts delimited, or are they delimited at all? There's a VBA function called split that takes the full string and the delimiter as arguments and returns an array of strings consisting of the seperate values.

Example:

dim wholename as string
dim nameparts(3) as string

wholename = "John Andrew Smith"
nameparts = split(wholename, " ")
 
Thanks for the reply. The string has spaces " " between each name. I tried using the code you gave above and received an error code stating "Sub or Function not defined" I'm using A97. Will split work in A97? Hope I've given you enough information to help me with my problem.

Thanks again for the reply,
Shane
 
See this FAQ by JimmyTheGeek on doing exactly what you're after:

faq181-37 Joe Miller
joe.miller@flotech.net
 
Joe,

I really appreciate the help. Haven't got time right now to take it for a spin but it does look like what I'm trying to accomplish.

Thanks again,
Shane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top