Sunday 22 October 2017

vba - Division formula in excel


I have 2 column Price, % of Total Price how do I get the value of % of total price using VBA.


I notice that there is no divide function for excel WorksheetFunction.Divide so how do I loop thru my price column to get the value and dividing against the total price to get the percentage?


This is the example



Answer



=B53/$B$65

Should work.


In VBA


Dim x as Double
x = Range("B53").Value / Range("B64").Value

Just format the cell as percentage.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...