ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   remove the ( ) & dashes from column of phone # (https://www.excelbanter.com/excel-worksheet-functions/97217-remove-dashes-column-phone.html)

alvie

remove the ( ) & dashes from column of phone #
 
Make a column of phone numbers with nothing but the numbers.

Don Guillett

remove the ( ) & dashes from column of phone #
 
If you have the column formatted as special (phone numbers) just change to
general. If not, use edit/replace
and trim OR in a helper column a nested substitute formula

--
Don Guillett
SalesAid Software

"alvie" wrote in message
...
Make a column of phone numbers with nothing but the numbers.




Gord Dibben

remove the ( ) & dashes from column of phone #
 
You could use EditReplace on each of the characters you don't want.

EditReplace

What: (

With: nothing

Replace all.

Or use a macro to do all at once.

Sub RemoveAlphas()
' Remove alpha characters from a string.
Dim intI As Integer
Dim rngR As Range, rngRR As Range
Dim strNotNum As String, strTemp As String
Set rngRR = Selection.SpecialCells(xlCellTypeConstants, _
xlTextValues)
For Each rngR In rngRR
strTemp = ""
For intI = 1 To Len(rngR.Value)
If Mid(rngR.Value, intI, 1) Like "[0-9]" Then
strNotNum = Mid(rngR.Value, intI, 1)
Else: strNotNum = ""
End If
strTemp = strTemp & strNotNum
Next intI
rngR.Value = strTemp
Next rngR
End Sub


Gord Dibben MS Excel MVP


On Sun, 2 Jul 2006 05:20:01 -0700, alvie
wrote:

Make a column of phone numbers with nothing but the numbers.




All times are GMT +1. The time now is 05:49 AM.

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