formula for telephone numbers.

B

biffula

I have a list of thousands of phone numbers. I have been trying
various formulas to no success. My phone numbers look like this:

(123)456-7890

and I need them to look like this:

1234567890

They are in columns. Thanks.
 
P

Peo Sjoblom

Do 3 replace, ctrl + h then in the find what box put (
leave the replace with empty

do the same with ) and -


--


Regards,


Peo Sjoblom
 
E

Elkar

You could use Find/Replace for each of the 3 symbols to eliminate.

Select all of your phone numbers
From the Edit Menu, choose "Replace"
In the Find What field, enter: (
Leave the Replace With field blank
Click "Replace All"
Repeat for ) and - symbols

HTH,
Elkar
 
B

biffula

You could use Find/Replace for each of the 3 symbols to eliminate.

Select all of your phone numbers
From the Edit Menu, choose "Replace"
In the Find What field, enter: (
Leave the Replace With field blank
Click "Replace All"
Repeat for ) and - symbols


So simple. It worked. Thanks everyone. NOW, my problem is some of
the numbers had spaces instead of hyphens. Any way to close the
numbers up?

Some now look like this:

123456 7890

Need to look like this:

1234567890
 
P

Peo Sjoblom

doing the same, replace space with nothing, hit space key once in the find
what box and leave replace with empty


--


Regards,


Peo Sjoblom
 
J

JP

Here's what I do. Select the cells you want to change and run this
macro.

Sub Convert_Phone()
Application.ScreenUpdating = False

With Selection.SpecialCells(xlConstants)
.Replace what:=Chr(160), Replacement:="", lookat:=xlPart,
searchorder:=xlByColumns, MatchCase:=True
.Replace what:=Chr(32), Replacement:="", lookat:=xlPart,
searchorder:=xlByColumns, MatchCase:=True
.Replace what:=")", Replacement:="", lookat:=xlPart,
searchorder:=xlByColumns, MatchCase:=True
.Replace what:="(", Replacement:="", lookat:=xlPart,
searchorder:=xlByColumns, MatchCase:=True
.Replace what:="-", Replacement:="", lookat:=xlPart,
searchorder:=xlByColumns, MatchCase:=True
.Replace what:="+", Replacement:="", lookat:=xlPart,
searchorder:=xlByColumns, MatchCase:=True
.Replace what:=".", Replacement:="", lookat:=xlPart,
searchorder:=xlByColumns, MatchCase:=True
.Replace what:="'", Replacement:="", lookat:=xlPart,
searchorder:=xlByColumns, MatchCase:=True
End With

Application.ScreenUpdating = True
End Sub


HTH,
JP
 

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