+ Reply to Thread
Results 1 to 4 of 4

Returning formatted output from a User defined function

  1. #1
    Salman
    Guest

    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. #2
    Jim Thomlinson
    Guest

    RE: 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. #3
    ABED HADDOU
    Guest

    RE: 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. #4
    NickHK
    Guest

    Re: Returning formatted output from a User defined function

    You mean ?

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

    NickHK

    "Salman" <[email protected]> wrote in message
    news:[email protected]...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1