ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional Font Color (https://www.excelbanter.com/excel-programming/348794-conditional-font-color.html)

Jim Brass

Conditional Font Color
 
How can I change the Font color based on a number?

I tried:

For Each Cell In Selection

On Error Resume Next

If Cell.Value < 140 Then Cell.Interior.ColorIndex = 30
If Cell.Value < 140 Then Cell.Font.ColorIndex = 2


'other code for lower temperatures

Next


Thanks for any help! Jim



Gary Keramidas

Conditional Font Color
 
seems to work here, you just have to have the cells selected before you
execute the code

--


Gary


"Jim Brass" wrote in message
...
How can I change the Font color based on a number?

I tried:

For Each Cell In Selection

On Error Resume Next

If Cell.Value < 140 Then Cell.Interior.ColorIndex = 30
If Cell.Value < 140 Then Cell.Font.ColorIndex = 2


'other code for lower temperatures

Next


Thanks for any help! Jim





All times are GMT +1. The time now is 12:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com