Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This seems like it should be easy, but i'm baffled!! In the code below,I want
to put the quotient of Cells E20 and E38, both of which contain positive integers, into Cell G40. The only value I get is zero. The code runs ok but obviously produces the wrong result. Can anyone tell me why this is? What am I missing? Thanks. Sub ComputeAssetRatios() Application.Worksheets("AssetAllocation").Activate Dim Numerator As Range Dim Denominator As Range Dim Ratio Dim x Dim y Dim z Set Numerator = Worksheets("AssetAllocation").Range("E20") x = Numerator.Value Debug.Print Set Denominator = Worksheets("AssetAllocation").Range("E38") y = Denominator.Value Debug.Print Ratio = Application.WorksheetFunction.Quotient(x, y) Range("G40").Select Selection.Value = Ratio Debug.Print End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do i round a quotient to specific decimal places? | Excel Worksheet Functions | |||
Why QUOTIENT function is not being recognized? | Excel Worksheet Functions | |||
Make divisions and display no decimal value at the quotient! | Excel Discussion (Misc queries) | |||
Is there a quotient function in VBA that's like Mod | Excel Programming | |||
How do I set a mimimum quotient value? | Excel Worksheet Functions |