View Single Post
  #6   Report Post  
Gord Dibben
 
Posts: n/a
Default

Copy the entire column and run this macro on that copy.

OR run it on the original column if you don't care to preserve the alphas.

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 Wed, 10 Nov 2004 21:17:01 -0800, "blackbeemer"
wrote:

How do you extract numbers or dates from a string of characters in a cell?
I have a string of characters. My dog has 3330 fleas. I want to place the
number in its own cell.