View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default FORMULA TO REMOVE TEXT FROM A CELL

Then, select the cells to be converted and run this macro:

Sub ExtractNumber()
Dim MyVal As Long
Dim n As Long

For Each cell In Selection.Cells
For n = 1 To Len(cell)
If IsNumeric(Mid(cell, n, 1)) Then
MyVal = MyVal & Mid(cell, n, 1)
End If
Next
cell.Value = MyVal
MyVal = 0
Next
End Sub

Regards,
Per

"Faraz A. Qureshi" skrev i
meddelelsen ...
I am sorry what I sought was to have all the text be removed. Like:

1234Text
12Text34
Text1234

be converted to:

1234
1234
1234

--
Best Regards,

Faraz



"Per Jessen" wrote:

Hi

Use this formula in a helper column, assuming 12 is a true value:

=IF(ISERROR(VALUE(A1)),VALUE(LEFT(A1,FIND("K"A1)-2))A1)

Regards,
Per

"Faraz A. Qureshi" skrev i
meddelelsen ...
I have some entries like:

10 Kg
15 Kilo
12
13.5 Kilogram

How, to have all the text be removed from the same having the
numericals
remained presented as:

10
15
12
13.5

--
Best Regards,

Faraz