ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Stripping Numbers Down to Bare Minimum (https://www.excelbanter.com/excel-programming/276895-stripping-numbers-down-bare-minimum.html)

Erik T. Nomad

Stripping Numbers Down to Bare Minimum
 
Is there a way I can quickly apply formatting to a column of phone
numbers such that I can get rid of all spaces, dashes, slashes and
parentheses and am left with only digits? I'm currently using a "Find
and Replace" command to do this, but I'd like to find a way to save
even more time. Thanks.

E

steve

Stripping Numbers Down to Bare Minimum
 
Erik,

Got this using the macro recorder and doing a quick edit to avoid the
select. With your numbers in column A (watch for word wrap)

Columns("A:A").Replace What:="-", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Columns("A:A").Replace What:=" ", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False


--
sb
"Erik T. Nomad" wrote in message
om...
Is there a way I can quickly apply formatting to a column of phone
numbers such that I can get rid of all spaces, dashes, slashes and
parentheses and am left with only digits? I'm currently using a "Find
and Replace" command to do this, but I'd like to find a way to save
even more time. Thanks.

E




Erik T. Nomad

Stripping Numbers Down to Bare Minimum
 
Awesome. Thanks!

E

"steve" wrote in message
...
Erik,

Got this using the macro recorder and doing a quick edit to avoid the
select. With your numbers in column A (watch for word wrap)

Columns("A:A").Replace What:="-", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Columns("A:A").Replace What:=" ", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False


--
sb
"Erik T. Nomad" wrote in message
om...
Is there a way I can quickly apply formatting to a column of phone
numbers such that I can get rid of all spaces, dashes, slashes and
parentheses and am left with only digits? I'm currently using a "Find
and Replace" command to do this, but I'd like to find a way to save
even more time. Thanks.

E






steve

Stripping Numbers Down to Bare Minimum
 
Erik,

Thanks! Glad to be of help.

But highly recommend the recorder. It's a great way to find code.
Of course it usually includes too much and should be modified after.
Especially the selecting parts...

--
sb
"Erik T. Nomad" wrote in message
...
Awesome. Thanks!

E

"steve" wrote in message
...
Erik,

Got this using the macro recorder and doing a quick edit to avoid the
select. With your numbers in column A (watch for word wrap)

Columns("A:A").Replace What:="-", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Columns("A:A").Replace What:=" ", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False


--
sb
"Erik T. Nomad" wrote in message
om...
Is there a way I can quickly apply formatting to a column of phone
numbers such that I can get rid of all spaces, dashes, slashes and
parentheses and am left with only digits? I'm currently using a "Find
and Replace" command to do this, but I'd like to find a way to save
even more time. Thanks.

E









All times are GMT +1. The time now is 11:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com