Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Removing text from cells

Have Excel 2002, want to remove text from cells and leave the numerical data
in those cells intact. Don't see a method for this in worksheet functions
listed by category / text & data.
--
labor market analyst, NW Ohio
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Removing text from cells

Hi,

We need some sample strings to extract the numbers from. The solution can be
very different depending on how the numbers and text are mixed up.

Mike

"don wonnell" wrote:

Have Excel 2002, want to remove text from cells and leave the numerical data
in those cells intact. Don't see a method for this in worksheet functions
listed by category / text & data.
--
labor market analyst, NW Ohio

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Removing text from cells

The below formula will extract contents from the 1st numeric onwards..Try
and post back whether this will work for all your data?

spray 2.5oz -------------will return 2.5oz
body spray 2.5oz -------will return 2.5oz

=MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"01234 56789")),LEN(A1))


If this post helps click Yes
---------------
Jacob Skaria


"don wonnell" wrote:

Have Excel 2002, want to remove text from cells and leave the numerical data
in those cells intact. Don't see a method for this in worksheet functions
listed by category / text & data.
--
labor market analyst, NW Ohio

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Removing text from cells

Hi,

One way to interpret this questions, since you didn't give us any examples,
is if cells contain text you want to clear them, if not you want them
unchanged.

1. Press F5, Special, turn on Constants, and uncheck everything except
Text, click OK.
2. Press the Del key.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"don wonnell" wrote:

Have Excel 2002, want to remove text from cells and leave the numerical data
in those cells intact. Don't see a method for this in worksheet functions
listed by category / text & data.
--
labor market analyst, NW Ohio

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Removing text from cells

Remove all but numbers using UDF

Function RemAlpha(str As String) As String
'Remove Alphas from a string
Dim re As Object
Set re = CreateObject("vbscript.regexp")
re.Global = True
re.Pattern = "\D"
RemAlpha = re.Replace(str, "")
End Function

Macro to do in place.

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 Mon, 8 Jun 2009 05:40:01 -0700, don wonnell
wrote:

Have Excel 2002, want to remove text from cells and leave the numerical data
in those cells intact. Don't see a method for this in worksheet functions
listed by category / text & data.


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
Removing Text infinite1013 Excel Discussion (Misc queries) 5 August 4th 08 04:55 PM
Removing text from a cell with text and numbers DoubleZ Excel Discussion (Misc queries) 2 July 8th 08 10:14 PM
Removing text pokdbz Excel Discussion (Misc queries) 10 August 7th 07 01:44 AM
question about removing text from cells, leaving numbers JPN5804 Excel Discussion (Misc queries) 3 November 28th 05 05:55 PM


All times are GMT +1. The time now is 09:01 AM.

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"