ASAP Utilities, a free add-in available from www.asap-utilities.com has the
ability to delete all alpha characters as one of their many fine
features............
The formula you posted: =LEFT(A2,FIND(" ",A2)-1) worked for "4.57
Dividend" , but I find that some of the cell values contain an
additional space between the $ and the first number, e.g. "$ 0.57
Dividend. What would be the correct formula for that?
If there is going to be considerable variability in the precise contents of the
cell, you might be better off with a User Defined Function (UDF) written in
visual basic.
To enter it:
<alt-F11> opens the VB Editor.
Ensure your project is highlighted in the project explorer window, then
Insert/Module and paste the code below into the window that opens.
To use this UDF, in some cell enter the formula:
=GetVal(A1)
where A1 contains your string.
========================
Function GetVal(str) As Double
Dim i As Long
Dim temp As Variant
For i = 1 To Len(str)
temp = Val(Mid(str, i, 255))
If temp <> 0 Then
GetVal = temp
Exit Function
End If
Next i
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.