UDF is not working
Hi Max,
The returned value is text, with which you can't calculate directly.
You can use
=VALUE(mypc(A1))
or, if you want the format to show, =VALUE(B1) if the formula is in B1
In case you wanted to ask; you cannot format a cell from a function.
--
Kind regards,
Niek Otten
Microsoft MVP - Excel
"Max" wrote in message ...
| Hi , i create UDF mypc which gives percent of the passed number as i need to
| change the number format of given cell on some calculation,
|
|
| function mypc(rng as long)
| mypc=format(rng,"percent")
| end function
|
| Suppose In worksheet , A1 contains value 5
|
| In B2, i type = mypc(A1) - RETURNS 500%, but i am not able to perform
| calculation on this returned values.
|
| please help
| Thanx
|