Here is a UDF. If you're new to VBA, look here first:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
The function returns text, so use it like:
=VALUE(StripTxt(A1))
'
=============================================================================
Function StripTxt(a As String) As String
' Strips all non-numeric characters from a string
' Returns a string, not a number!
Dim i As Long
Dim b As String
For i = 1 To Len(a)
b = Mid$(a, i, 1)
If (Asc(b) > 47 And Asc(b) < 58) Or b = Application.DecimalSeparator _
Then StripTxt = StripTxt + b
Next i
End Function
'
=============================================================================
--
Kind regards,
Niek Otten
"Bob Umlas" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Well, heres ONE way - requires 2 steps.
> If A1 has the string, Ctrl/shift/enter this in B1
> =MATCH(TRUE,ISERROR(1*MID(MID(A1,MATCH(FALSE,ISERROR(1*MID($A1,COLUMN(A:Z),1
> )),0),40),COLUMN(A:Z),1)),0)-1
> and ctrl/shift/enter this in C1 (the answer):
> =1*LEFT(MID(A1,MATCH(FALSE,ISERROR(1*MID($A1,COLUMN(A:Z),1)),0),40),B1)
> I imagine there's an easier way, but it's the first way that comes to
> mind.
> Probably easiest would be a UDF.
>
>
> "Brian" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Howdy All,
>>
>> Just curious if this is possible.
>>
>> I have a text string in a cell A1 such as "vol 25k/mo".
>>
>> I want to be able to extract just the '25' from that string for use in a
>> formula.
>>
>> Is there a way to do this?
>>
>> Thanks,
>> Brian
>>
>>
>
>