LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default extract a phone number from formatting

Couple of methods......

1. EditReplace 3 times to remove the () and - with nothing

2. A macro.

Sub RemoveAlphas()
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 Thu, 24 Aug 2006 10:20:01 -0700, Nick C <Nick
wrote:

Hello,
I am trying to extract a long list of phone numbers from text
i.e.:
i am trying to get 9998887777 out of (999)888-7777
(these cells are not formatted, the parenthesis and dashes were manually
typed in)
Any good ideas?


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formatting cell number based on previous cell number Pasquini Excel Discussion (Misc queries) 3 June 20th 06 06:36 AM
Format change of phone number helpjim Excel Discussion (Misc queries) 7 May 18th 06 07:34 PM
formatting number value to text value in excel jazzydwit Excel Worksheet Functions 2 December 29th 05 03:17 AM
Auto Formatting Custom Number CSBUG Excel Discussion (Misc queries) 4 November 17th 05 07:57 PM
concatenating and formatting area code and phone number columns sherri Excel Worksheet Functions 4 September 1st 05 09:59 PM


All times are GMT +1. The time now is 04:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"