#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default UDF return

I have a problem,

When my UDF return a value in a worksheet I need that the value will b
numerical value with format (like %).

How can I do it?

Thank

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default UDF return

use FormatPercent to create a string representation of the numeric value.

Dim x As Double, fx As String
x = 0.1235
fx = FormatPercent(x)

You can control the number of decimal values eg

fx = FromatPercent(x,4)

Cheers
Nigel


"ampm " wrote in message
...
I have a problem,

When my UDF return a value in a worksheet I need that the value will be
numerical value with format (like %).

How can I do it?

Thanks


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default UDF return

Hi
I would suggest to format the target cell as percentage and just return
the correct numerical value. I wouldn't return a string as this may be
problematic in further calculations

--
Regards
Frank Kabel
Frankfurt, Germany


I have a problem,

When my UDF return a value in a worksheet I need that the value will
be numerical value with format (like %).

How can I do it?

Thanks


---
Message posted from http://www.ExcelForum.com/


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
Return date if in range, else return blank LisaL Excel Worksheet Functions 1 July 22nd 09 03:23 PM
Compare Value in Cell 1 to a List, Return Value if Match otherwise Return Null Ben Excel Discussion (Misc queries) 2 March 15th 07 01:02 AM
LOOKUP and return the column heading for IF/THEN return for False NN Excel Discussion (Misc queries) 1 October 6th 06 11:24 AM
check if reference exists, then return its value or return 0 doudou Excel Worksheet Functions 1 June 4th 05 09:17 PM
VBA Syntax for VLOOKUP to return array of return values Alan Beban[_3_] Excel Programming 7 August 5th 03 11:41 AM


All times are GMT +1. The time now is 02:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"