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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting numbers from a text sequence in Word 1

Status
Not open for further replies.

DLG0311

Technical User
Jan 6, 2005
13
GB
The following text sequence needs to have the individual numbers extracted which are then put in individual boxes in a table: "69100 69101 69102 69102" etc

The "problem" is that different departments use different length numbers and some even use Alphanumeric designations.

How can I take the sequence, look as far as a space and take the number to that point then move to the next text after the space and find the number before the following space and so on for the length of the text (len(text))

My current solution only works for me (i.e. 5 digit space 5 digit etc.)
 
hi,

Code:
dim a, i, s
s = "69100 69101 69102 69102"
a = split(s, " ")
for i = 0 to ubound(a)
  msgbox a(i)
next


Skip,
[sub]
[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue][/sub]

 
Thanks very very much Skip,

perhaps you'd have the time to explain why/how this works

Thanks again

darslg
 
Take a look at VB Help on Split. Post back if you have further questions.

Skip,
[sub]
[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue][/sub]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top