How apply color scale to the font color and not the cell background color?

ChetShannon

Board Regular
Joined
Jul 27, 2007
Messages
133
Office Version
  1. 365
Platform
  1. Windows
I am trying to apply a color scale on the font color using the conditional format color scales function in MS365. I know how to apply this function to the cell background color but I'd rather change just the font color and leave the background color white to show the varying value levels in the cells. Any ideas on how to do this? Is there anything built-in to do this or do I just have to use conditional formatting the old-fashioned way?

Thanks,
Chet
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Unfortunately, you cannot use colour scales to change the font, rather than cell colour.
 
Upvote 0
Are there any workarounds for changing the font color based on a function similar to color scales?
 
Upvote 0
You would need to set up an number of rules, one for each colour you want to use.
 
Upvote 0
If you found this thread from google, the easiest way to do this is to set up your conditional formatting with cell colour scales, then use VBA to set the font colour to the cell colour.

For example I used the following one-off code, which sets the font colour of each row in my selection to the cell colour of the third column in my selection.


VBA Code:
Sub Fontcolour()

Dim Tbl As Range
Set Tbl = Selection

For i = 1 To Tbl.Rows.Count
    Tbl.Rows(i).Font.Color = Tbl.Cells(i, 3).DisplayFormat.Interior.Color
Next i

End Sub

It looked like this:

1656690397957.png



If you need this to run dynamically you'd have to have some cleverer VBA running on a worksheet event.
 
Upvote 0

Forum statistics

Threads
1,213,496
Messages
6,113,995
Members
448,539
Latest member
alex78

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top