Modify list of phone numbers in a column...

B

biffula

I have a list of thousands of phone numbers in a column. Some look
like this:

123465 7890

I need all the spaces closed and for them to end up looking like this:

1234567890

Thanks in advance.
 
P

Pete_UK

Highlight the cells containing the phone numbers, then CTRL-H (Find &
Replace):

Find What: <space> (i.e. type one space)
Replace with: leave blank

then click Replace All. Note that this will convert the values into
numbers, rather than text, so you will loose leading zeros (if you
have any).

Hope this helps.

Pete
 
G

Guest

Hi

Select the cells, go to Edit > Replace, and fill the textboxes such that you
change a space (just type a space in the first) box by "nothing" (leave the
second box empty). Choose to Replace All.
 
G

Gord Dibben

Function DeleteNonNumerics(ByVal sStr As String) As Long
Dim i As Long
If sStr Like "*[0-9]*" Then
For i = 1 To Len(sStr)
If Mid(sStr, i, 1) Like "[0-9]" Then
DeleteNonNumerics = DeleteNonNumerics & Mid(sStr, i, 1)
End If
Next i
Else
DeleteNonNumerics = sStr
End If
End Function

=deletenonnumerics(A1) copy down.


Gord Dibben MS Excel MVP
 

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