data string

L

Lourdes Benito

Hi:

How do i load this data string from one field into 7 fields where the "-" is
the separator?
01-00-000-000-1698-00-0000

Thanks.
Lourdes
 
D

Douglas J. Steele

If that's stored in a variable strInput, you can use the following:

Dim intLoop As Integer
Dim varValues As Variant

varValues = Split(strInput, "-")

If IsNull(varValues) = True Then
' There was nothing in strInput
Else
For intLoop = LBound(varValues) To UBound(varValues)
Debug.Print varValues(intLoop)
Next intLoop
End If

For the input you gave, varValues(0) would be 01, varValues(1) would be 00,
varValues(2) would be 000 and so on until varValues(6), which would be 0000
 
L

Lourdes Benito

Thanks for the quick reply. I'm not too familiar with MACROS & MODULES so
how should I approach the listed code?

Lourdes
 
L

Lourdes Benito

How do I get this store data into specific fields in a table? For example,
how do I tell it to take the first two digits and store data to the field
named 113 CO in a table?

Thanks.
Lourdes
 

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

Top