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

Using Excel 2k, I have this:
....
If intCount / 12 50 Then
intCount = 49.9 * 12
Selection.Font.ColorIndex = 3
Exit Do
End If
Loop

CCPayoutYears = intCount / 12

End Function...

in a function (CCPayoutYears) to compute years to pay off a credit card and
want to set the cell to 49.9 if it is over 50 years and set the font color
to red. intCount is the number of months accumulated in the loop.

It doesn't work. What am I missing?

Dave


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Font color

Hi
do you call this function from your worksheet as worksheet formula. If
yes: no chance to change the format of a cell as user defined functions
can only return values but can't change the Excel environment

--
Regards
Frank Kabel
Frankfurt, Germany


Dave Dawson wrote:
Using Excel 2k, I have this:
...
If intCount / 12 50 Then
intCount = 49.9 * 12
Selection.Font.ColorIndex = 3
Exit Do
End If
Loop

CCPayoutYears = intCount / 12

End Function...

in a function (CCPayoutYears) to compute years to pay off a credit
card and want to set the cell to 49.9 if it is over 50 years and set
the font color to red. intCount is the number of months accumulated
in the loop.

It doesn't work. What am I missing?

Dave


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Font color

Assuming that this is a function called from a worksheet, you can't change
anything in a cell, only return a value. So you cannot set the font colour
from within that worksheet function.

--
HTH

-------

Bob Phillips
"Dave Dawson" wrote in message
...
Using Excel 2k, I have this:
...
If intCount / 12 50 Then
intCount = 49.9 * 12
Selection.Font.ColorIndex = 3
Exit Do
End If
Loop

CCPayoutYears = intCount / 12

End Function...

in a function (CCPayoutYears) to compute years to pay off a credit card

and
want to set the cell to 49.9 if it is over 50 years and set the font color
to red. intCount is the number of months accumulated in the loop.

It doesn't work. What am I missing?

Dave




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
Checkbox to change background color, font color and remove/ add bo Sara Excel Discussion (Misc queries) 2 May 1st 23 11:43 AM
Conditional Format for font color using font color Jim Excel Worksheet Functions 2 August 29th 09 11:54 AM
Changing Font color based on font type or size John Excel Discussion (Misc queries) 2 February 7th 08 12:50 AM
How to change the default Border, Font Color, and Cell Color Elijah Excel Discussion (Misc queries) 3 November 2nd 05 11:52 PM
My fill color and font color do not work in Excel Std Edition 2003 chapstick Excel Discussion (Misc queries) 1 September 11th 05 08:48 PM


All times are GMT +1. The time now is 03:32 AM.

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

About Us

"It's about Microsoft Excel"