extract multiple numbers from string

L

learning44

Hi, How can I extract multiple numbers from a single text field where
multiple numbers are separated by a comma? Each record looks something like
this:(NumField1) [78115, 98112, 98991] OR (NumField2) [26775,18667]. I want
to associate each extracted number from within brackets with another number
from same record (in parens) and append pair to a table. Thanks for any help.
 
D

Douglas J. Steele

Try using the Split function.

Dim varValues As Variant

varValues = Split(NumField1)

will create an array where varValues(0) will be 78115, varValues(1) will be
98112 and varValues(2) will be 98991 for the data you gave.
 
L

learning44 via AccessMonster.com

Thanks Doug, I'll give it a try.
Try using the Split function.

Dim varValues As Variant

varValues = Split(NumField1)

will create an array where varValues(0) will be 78115, varValues(1) will be
98112 and varValues(2) will be 98991 for the data you gave.
Hi, How can I extract multiple numbers from a single text field where
multiple numbers are separated by a comma? Each record looks something
[quoted text clipped - 5 lines]
from same record (in parens) and append pair to a table. Thanks for any
help.
 

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