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

I've made a custom function and I want the value displayed in the cell to
show up as a percentage but don't want to have to togle the % style manually
every time I use it. I've tried everything I can think of to get it to show
up as a percent but get the #VALUE error every time. The Selection.Style =
"Percent" works in macros and whatnot. Does it not work in functions? or is
there some other way you have to do it in functions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Functions

No it doesn't, you cannot get a function to set any of the cell attributes.

You could format the value as a percentage and return that, but then it
would be text not a number.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"fishonspeed" wrote in message
...
I've made a custom function and I want the value displayed in the cell to
show up as a percentage but don't want to have to togle the % style
manually
every time I use it. I've tried everything I can think of to get it to
show
up as a percent but get the #VALUE error every time. The Selection.Style =
"Percent" works in macros and whatnot. Does it not work in functions? or
is
there some other way you have to do it in functions?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Functions

Can a function call a macro inside of itself to set the cell format style?
--
I dispise your poor English and inability to use punctuation correctly ...
or at all.
~FishOnSpeed


"Bob Phillips" wrote:

No it doesn't, you cannot get a function to set any of the cell attributes.

You could format the value as a percentage and return that, but then it
would be text not a number.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"fishonspeed" wrote in message
...
I've made a custom function and I want the value displayed in the cell to
show up as a percentage but don't want to have to togle the % style
manually
every time I use it. I've tried everything I can think of to get it to
show
up as a percent but get the #VALUE error every time. The Selection.Style =
"Percent" works in macros and whatnot. Does it not work in functions? or
is
there some other way you have to do it in functions?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Functions

If it's originally started from a worksheet cell, then your function can't do
it.

No matter how deep you bury it in subroutines and functions, excel still knows
it started on a worksheet.

fishonspeed wrote:

Can a function call a macro inside of itself to set the cell format style?
--
I dispise your poor English and inability to use punctuation correctly ...
or at all.
~FishOnSpeed

"Bob Phillips" wrote:

No it doesn't, you cannot get a function to set any of the cell attributes.

You could format the value as a percentage and return that, but then it
would be text not a number.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"fishonspeed" wrote in message
...
I've made a custom function and I want the value displayed in the cell to
show up as a percentage but don't want to have to togle the % style
manually
every time I use it. I've tried everything I can think of to get it to
show
up as a percent but get the #VALUE error every time. The Selection.Style =
"Percent" works in macros and whatnot. Does it not work in functions? or
is
there some other way you have to do it in functions?





--

Dave Peterson
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
How to convert cell formula functions to code functions Adnan Excel Discussion (Misc queries) 1 October 1st 08 08:30 PM
efficiency: database functions vs. math functions vs. array formula nickname Excel Discussion (Misc queries) 2 July 14th 06 04:26 AM
Looking for a site with functions that substitute the ATP functions Franz Verga Excel Worksheet Functions 3 June 24th 06 04:30 AM
Conversion from Spreadsheet Toolkit functions (ESSV....) to EssBase API functions sujay Excel Programming 0 June 5th 06 10:13 AM
excel functions and User defined functions Kanan Excel Programming 4 May 20th 04 11:21 PM


All times are GMT +1. The time now is 01:22 AM.

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"