Color part of a cell's contents

steve the excel guy

Board Regular
Joined
Aug 28, 2007
Messages
104
I have looked everywhere and can't seem to find a simple way. First, I was looking for a formula to add into the following:

=TEXT(TODAY(),"mmmm d, yyyy")&" ["&TEXT(TODAY(),"dddd")&"]"

...where the day part would show up as a different color, whether it be red or dark grey... whatever.

Right now, the outcome accurately shows as July 30, 2010 [Friday]. I want [Friday] to be a different color. Is that possible?
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Sorry, but it's not possible.

If the cell contains a formula, any formatting will apply to the ENTIRE result of the formula.


If you wanted part of the cell to be a different format, you would have to remove the formula.
Copy / Paste Special / Values

Then you can change the font for just part of the cell's value.
 
Last edited:

steve the excel guy

Board Regular
Joined
Aug 28, 2007
Messages
104
Arrgghh... ok well thank you.

I guess the alternative is to do something in VBA, right? There has to be some kind of possibility because if I type "FRIDAY" into a cell and manually highlight "DAY", I can change the font color of part of the word.

So perhaps there is a way in VBA to call "[FRIDAY]" and change it's color? I think I ran across a VBA command called RGB or something in the past. I don't know how to use it though.
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Even in VBA, if the cell contains a formula, then no.

But if you want a vba approach to remove the formula, and apply formatting to the remaining value, then yes it's doable.
 

Watch MrExcel Video

Forum statistics

Threads
1,133,639
Messages
5,660,028
Members
418,543
Latest member
alreadybeen23

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
Top