Results 1 to 14 of 14

Thread: Solved: return formatted number from function?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,776
    Do you want the function to return a number or a string.?

    Percentages are numbers. There is no difference between a number and a percentage, other than the format in which it is shown. The format of the destination cell can be set to show the number as in "0.00%" format. But functions can't set cell formats. (Not when called from a worksheet.)

    If you want your function to return a string, changing the function type declaration and using
    TEST=Format(tmp,"0.00%")
    should do it.
    Last edited by mikerickson; 12-16-2007 at 02:49 PM.

Posting Permissions

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