How to calcualte % of a number in code.

  • Thread starter Thread starter Freddie
  • Start date Start date
F

Freddie

I am trying to get the percentage of a certatin number. Can anyone adivse on
the correct way to do this via vba code?
For instance how would I caculate, 528 it what pertage of 2703?
 
Freddie said:
I am trying to get the percentage of a certatin number. Can anyone adivse on
the correct way to do this via vba code?
For instance how would I caculate, 528 it what pertage of 2703?


xx = 528 / 2703
will give you the value .195 in a variable named xx. If you
want to display it as 19.5% then specify the text box's
format as Percent.

If you want the value to actually be 19.5, then use:
yy = (528 / 2703) * 100
 
Back
Top