Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Juan
 
Posts: n/a
Default Removing only certain data in a cell

If I have a cell that contains the following, (Phone 123-456-7890), is there
a formula I can use that will strip the number off and put it in another
cell? I have a big list I need to clean up, and doing it one at a time will
take to long. Thanks
  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
see:
http://www.dicks-blog.com/archives/2...t-1/trackback/

--
Regards
Frank Kabel
Frankfurt, Germany
"Juan" schrieb im Newsbeitrag
...
If I have a cell that contains the following, (Phone 123-456-7890), is
there
a formula I can use that will strip the number off and put it in another
cell? I have a big list I need to clean up, and doing it one at a time
will
take to long. Thanks



  #3   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

A help column and

=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"Phone", ""),"(",""),")",""))

and if you don't want the hyphens

=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE( A1,"Phone",""),"(",""),")",""),"-",""))

and if you want a real number

=--TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A 1,"Phone",""),"(",""),")",""),"-",""))

Of course you might be best off just using editreplace

Regards,

Peo Sjoblom





"Juan" wrote:

If I have a cell that contains the following, (Phone 123-456-7890), is there
a formula I can use that will strip the number off and put it in another
cell? I have a big list I need to clean up, and doing it one at a time will
take to long. Thanks

  #4   Report Post  
Gord Dibben
 
Posts: n/a
Default

Juan

Macro to strip all but 123-456-7890.

Copy the original column to an adjacent column then run this macro on the
copied column.

If you don't care about anything but the 123-456-7890 then don't bother
copying the column.

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 Excel MVP

On Thu, 16 Dec 2004 15:35:02 -0800, "Juan"
wrote:

If I have a cell that contains the following, (Phone 123-456-7890), is there
a formula I can use that will strip the number off and put it in another
cell? I have a big list I need to clean up, and doing it one at a time will
take to long. Thanks


  #5   Report Post  
CLR
 
Posts: n/a
Default

=RIGHT(A1,12) and copy down............

Vaya con Dios,
Chuck, CABGx3



"Juan" wrote in message
...
If I have a cell that contains the following, (Phone 123-456-7890), is

there
a formula I can use that will strip the number off and put it in another
cell? I have a big list I need to clean up, and doing it one at a time

will
take to long. Thanks



Reply
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
entering data in certain cell Craig Sayers Links and Linking in Excel 1 December 30th 04 05:17 PM
Returning Data from a third cell in same row that meets two other USChad Excel Discussion (Misc queries) 3 December 16th 04 04:53 PM
Running Data Table using an input that triggers DDE linked data [email protected] Excel Discussion (Misc queries) 1 December 16th 04 12:56 PM
I need a macro to find cut and paste data to new cell Rex Excel Discussion (Misc queries) 0 December 6th 04 01:23 AM
Dragging cell data Ricardinho Excel Discussion (Misc queries) 1 November 28th 04 12:10 PM


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

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

About Us

"It's about Microsoft Excel"