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: 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
 
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
Howw can I make a function return a date in date format Jan Kronsell Excel Programming 12 January 21st 10 04:24 PM
Make VBA wait for return from external function Gib Bogle Excel Programming 8 January 3rd 09 03:42 AM
How do I make the true return a drop down list in the IF function? Brian Excel Worksheet Functions 5 April 13th 06 09:40 PM
trying to make a formula for percent if greater than a value cervenyc Excel Discussion (Misc queries) 10 January 12th 06 05:45 PM
Percent Format without Percent Sign jstrater Excel Programming 1 April 29th 04 07:28 AM


All times are GMT +1. The time now is 03:09 AM.

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"