Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Returning formatted output from a User defined function

Hi,
I need a user defined function to return formatted output

function userdefined(arg1, arg2) as double
userdefined = arg1/arg2
end function

I want the output as a percentage. Pls let me know the statement for that.
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Returning formatted output from a User defined function

UDF's can not modify formats. A function called from within Code can act upon
any cells to change formats and whatever else that they want. When called
from a sheet however UDF's can ONLY return values to the cell that they are
in. They can not modify the values of cells that they are not in and they can
not modify the format of any cells. Just one of those rules...
--
HTH...

Jim Thomlinson


"Salman" wrote:

Hi,
I need a user defined function to return formatted output

function userdefined(arg1, arg2) as double
userdefined = arg1/arg2
end function

I want the output as a percentage. Pls let me know the statement for that.
Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Returning formatted output from a User defined function

Bonsoir Salman « Salem »

si j'ai bien compris voilÃ* ce que tu cherchais

Function userdefined(arg1, arg2)
Application.Volatile
userdefined = FormatPercent(arg1 / arg2, 0)
End Function

Abed_H


"Salman" a écrit :

Hi,
I need a user defined function to return formatted output

function userdefined(arg1, arg2) as double
userdefined = arg1/arg2
end function

I want the output as a percentage. Pls let me know the statement for that.
Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Returning formatted output from a User defined function

You mean ?

function userdefined(arg1, arg2) as double
userdefined = arg1/arg2 * 100
end function

NickHK

"Salman" wrote in message
...
Hi,
I need a user defined function to return formatted output

function userdefined(arg1, arg2) as double
userdefined = arg1/arg2
end function

I want the output as a percentage. Pls let me know the statement for that.
Thanks.



Reply
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
User Defined Function returning #Value! DogLover Excel Worksheet Functions 4 November 25th 09 07:31 PM
Returning Values From a User-Defined Type BobbyMurcerFan[_2_] Excel Programming 2 March 26th 06 07:58 PM
User Defined Fuction Returning Range Help xcelion Excel Programming 7 November 22nd 04 02:39 PM
User Defined Function: Format Output Kenny Excel Programming 5 April 29th 04 11:40 PM
AutoExpanding User Defined Function Output MikeCave Excel Programming 1 March 1st 04 10:29 AM


All times are GMT +1. The time now is 05:16 PM.

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"