View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\)[_137_] Rick Rothstein \(MVP - VB\)[_137_] is offline
external usenet poster
 
Posts: 1
Default convert fractions to decimals

Can you use a macro? If so, you can have your macro call this subroutine...

Sub Solve(R As Range)
Dim C As Range
For Each C In R
C.Value = Application.Evaluate(Replace(LCase$(C.Value), "x", "*"))
Next
End Sub

Simply have your macro pass in the range of cells you want to convert from
fractional calculations to numerical values. Something like this...

Sub TestMacro()
Solve Range("D10:D12")
End Sub

Note, as long as you use either "x", "X" or "*" for multiplication, "/" for
division, "+" for addition and "-" for subtraction, coupled with lots of
other functions (such as Sin, Sqrt, etc.) and parentheses, you can do quite
complicated calculations with it.

Rick


"Shannon" <Shannon @discussions.microsoft.com wrote in message
...
Does anyone kow if you can convert the following fraction to a decimal
automatically.

7/8 x 2 1/4?

Thanks in advance, I will score big brownie points with the boss if we can
figure this one out :)