View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John Black John Black is offline
external usenet poster
 
Posts: 9
Default How to make a VBA Function return a value in percent format

Hi,

I've been searching google for a while on this question but I can't find anything. I wrote a
very simple function that returns the growth percentage between two numbers:

Function GP(Val1 As Double, Val2 As Double)
GP = (Val2 - Val1) / Val1
End Function

I would like the result to automatically be displayed in "%0.00" format but I cannot figure
out how to make that happen. Right now it returns a number like 0.45632 and I have to click
the cell and format it to percentage. Is this possible? Thanks.

John Black