View Single Post
  #6   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

In article ,
says...

John,

This should work, but it will return a string.

Function GP(Val1 As Double, Val2 As Double)
GP = Format((Val2 - Val1) / Val1, "%0.00")
End Function


Having it return a string may be a problem in some cases. But for grins, I tried this and it
output this:

%0.10

:-)

John Black