Seperating text

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

Guest

I have attribute data that is stored by operation as shown below (the top
line is the field names). I need to look up this data when it is selected by
an end user.

Sort Diam WallMin WallMax
Primary 1 .1 .2
Secondary 2 .2 .25

Here is the hard part. The data to select from is stored/selected as a
single text line such as "Primary Diameter". How can I seperate this into
two text fields based on the space between the two words?

Any assistance would be apprecieated. Thanks.
 
Justin said:
I have attribute data that is stored by operation as shown below (the top
line is the field names). I need to look up this data when it is selected by
an end user.

Sort Diam WallMin WallMax
Primary 1 .1 .2
Secondary 2 .2 .25

Here is the hard part. The data to select from is stored/selected as a
single text line such as "Primary Diameter". How can I seperate this into
two text fields based on the space between the two words?


You can use the InStr function to find the space and the
Left, Righr and Mid functions to extract the parts.

Left(data, InStr(data, " ") - 1) returns Primary
and
Mid(data, InStr(data, " ") + 1) returns Diameter
 
strX = "Primary Diameter"
aryZ = Split(strZ, " ")
Now you have an array where each element contains one word:
aryZ(0) = "Primary"
aryZ(1) = "Diameter"
 

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