LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Help with Excel VBA QUOTIENT

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i round a quotient to specific decimal places? gissineth Excel Worksheet Functions 3 March 4th 10 03:18 AM
Why QUOTIENT function is not being recognized? math function[_2_] Excel Worksheet Functions 3 July 17th 08 03:17 AM
Make divisions and display no decimal value at the quotient! FreakyShadow Excel Discussion (Misc queries) 2 March 5th 06 05:28 AM
Is there a quotient function in VBA that's like Mod WannaBeExceller Excel Programming 5 February 1st 06 09:11 PM
How do I set a mimimum quotient value? Robert Excel Worksheet Functions 4 January 19th 05 07:50 PM


All times are GMT +1. The time now is 02:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"