Can I highlight individual characters in a cell?

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
1,344
Office Version
  1. 365
Platform
  1. Windows
I have a column of data that shows whether a value is over or under a target value. I have the over values (>0) highlighted in red and the under values in green. By "highlight" I mean the fill color, not the color of the characters themselves.

The column has a header with the characters "O/U". I would like to highlight the "O" in red and the "U" in green. If I edit the cell, the text color control is active, but the fill control is greyed out. I can easily do this in Word. Is it not possible in Excel?

Thanks
 

Some videos you may like

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Gerald Higgins

Well-known Member
Joined
Mar 26, 2007
Messages
9,115
I don't think this is possible in Excel. The fill control applies to the CELL in its entirety, not the portion of the cell that forms the background to a single text character.
 

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
1,344
Office Version
  1. 365
Platform
  1. Windows
That's what I was afraid of. Can I create the split highlighting in Word or some graphics program and put a graphic in the cell?
 

Tom.Jones

Active Member
Joined
Sep 20, 2011
Messages
308
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi,

Maybe I did not understand ....
Click on the cell with O/U, then in the formula bar, select the letter O and change the color to red (idem and the other letter).
 
Last edited:

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
19,258
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

Or for a VBA solution
This assumes the "O/U" column is Column "A" and does everything in that column

Code:
Sub MM1()
Dim lr As Long, r As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
For r = 2 To lr
    If InStr(Cells(r, 1).Value, "O") Then Cells(r, 1).Characters(Start:=1, Length:=1).Font.Color = -16776961
    If InStr(Cells(r, 1).Value, "U") Then Cells(r, 1).Characters(Start:=3, Length:=1).Font.Color = -11489280
Next r
End Sub
 

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
1,344
Office Version
  1. 365
Platform
  1. Windows
I want to change the fill (background) color, not the font color. And I just want to change the column header cell, not the entire column.

In the table below, I want to change the fill behind the "O" in C1 to red and the fill behind the "U" to green.

R/C
A
B
C
1
Value
Target
O/U
2
120
100
+20
3
80
90
-10
4
150
180
-30
5
75
50
+25

<tbody>
</tbody>

I would have attached a simple graphic showing what I want, but the forum administrators in their infinite wisdom have chosen not to allow attachments. I guess they don't know or don't believe that a picture is worth a thousand words. (sigh)
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
19,258
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

Ok, try...
Rclick on cell>>format cells>>Fill tab>> fill effects>>edit to suit.
Sadly that will be as close as you get !

on the other matter

but the forum administrators in their infinite wisdom have chosen not to allow attachments

By not adding attachments, you security is more protected, the forum generally is more protected, the forum is not filled with unnecessary data.
Suggesting the administrators "don't know" or "don't believe", is a bit much, considering that this site is one of the more popular ones AND has been for a very long time !!

Had you read the guidelines for posting you would have seen the section on how to post images and or data
https://www.mrexcel.com/forum/board-announcements/127080-guidelines-forum-use.html

As well as the fact that you could have used dropbox to upload you attachment, then post a link back here.
 
Last edited:

dcoker

New Member
Joined
Dec 13, 2018
Messages
25
Hi,

Would you be opposed to simply adding a shape with the appropriate color and changing the transparency for each shape so the letter will show?
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,593
Office Version
  1. 2007
Platform
  1. Windows
You could upload a copy of your file or image file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here.
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,593
Office Version
  1. 2007
Platform
  1. Windows
You need something like this


https://www.dropbox.com/s/9lkbpzs7ztr6e3g/ou.jpg?dl=0
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,109,027
Messages
5,526,329
Members
409,696
Latest member
EERS

This Week's Hot Topics

Top