extract number from a cell
Hi again,
Am Wed, 14 Jun 2017 17:18:21 +0200 schrieb Claus Busch:
try in B1:
=LOOKUP(9^9,1*RIGHT(MID(A1,1,FIND(" ",A1)-1),COLUMN(A1:IQ1)))
or do it with an UDF:
Function myPrice(myRng As Range) As Double
Dim varData As Variant
Dim re As Object
Dim ptrn As String
Set re = CreateObject("vbscript.regexp")
ptrn = "[a-z] {0,}"
re.Pattern = ptrn
re.IgnoreCase = True
re.Global = True
varData = Split(myRng, " ")
myPrice = re.Replace(varData(0), "")
End Function
and call that function in the sheet with e.g.
=myPrice(A1)
Regards
Claus B.
--
Windows10
Office 2016
|