Extract phone number from word file

D

Don Lincoln

Hello

I’m looking for a word macro that will extract numbers from a word file

Its has bunch of numbers. The format of those numbers are ###+###-####
so it’s a 10 digit format after first 3 digits there is a plus sign an
then after 3 digits there is a minus sign and then the last 4 digits.

What the macro should do is find the phone number and extract that int
a new word window and then if the there is a DUPLICATE OF THAT NUMBE
then the word should SKIP THAT NUMBER. and then search and extract th
next number since the file has lots of duplcate number and i only nee
unique numbers.

Below is the sample data,



data data data data data data data data data data data data data dat
data 951+907-3887 data data data data data data data data data data dat
data data data data 951+907-3887 data data data data data data data dat
data data data data data data data 951+907-3887 data data data data dat
data data data data data data data data data data 916+555-1212 data dat
data data data data data data data data data data data data dat
916+555-1212 data data data data data data data data data data data dat
data data data


Thanks
 
L

Lisa Wilke-Thissen

Hi,
I 'm looking for a word macro that will
extract numbers from a word file

which version of Word?
The format of those numbers are ###+###-####,

No macro, but you can choose the "Find" command to select all those
numbers. And then copy and paste them into another document (I would
prefer an Excel sheet):

1. Ctrl + H | Find | More
2. Find what: ^#^#^#+^#^#^#-^#^#^#^#
3. Find in: Main document

All instances will be selected. So you can copy/paste them at once.

In Excel 2010 you can easily remove duplicates:
On the Data tab, in the Data Tools group, click Remove Duplicates.
 

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