How to convert this text number and fraction to 1 figure using mac
Dim posSpace As Long
Dim posSlash As Long
Dim numChars As Long
Dim tmp As Variant
With ActiveCell
numChars = Len(.Text)
posSpace = InStr(.Text, " ")
posSlash = InStr(.Text, "/")
tmp = Mid(.Text, posSlash - 1, posSlash - posSpace - 1) / Mid(.Text,
numChars, posSlash - 1)
tmp = Left$(.Text, posSpace - 1) & tmp * 100
.Value = Val(tmp)
End With
--
__________________________________
HTH
Bob
"swiftcode" wrote in message
...
Hi all,
I have this text in a number of cells typed in as e.g. ".09 1/4" which in
numeric terms is 0.0925.
My questions is, can someone please help me think of a simple macro to
automatically covert the cell to a numeric.
Many thanks in advance.
Ray
|