Can I highlight individual characters in a cell?

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,687
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
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
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.
 
Upvote 0
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?
 
Upvote 0
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:
Upvote 0
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
 
Upvote 0
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.

[TABLE="class: grid, width: 350"]
<tbody>[TR]
[TD="align: center"]R/C
[/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"]B
[/TD]
[TD="align: center"]C
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD="align: center"]Value
[/TD]
[TD="align: center"]Target
[/TD]
[TD="align: center"]O/U
[/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD="align: center"]120
[/TD]
[TD="align: center"]100
[/TD]
[TD="align: center"]+20
[/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD="align: center"]80
[/TD]
[TD="align: center"]90
[/TD]
[TD="align: center"]-10
[/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD="align: center"]150
[/TD]
[TD="align: center"]180
[/TD]
[TD="align: center"]-30
[/TD]
[/TR]
[TR]
[TD="align: center"]5
[/TD]
[TD="align: center"]75
[/TD]
[TD="align: center"]50
[/TD]
[TD="align: center"]+25
[/TD]
[/TR]
</tbody>[/TABLE]

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)
 
Upvote 0
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:
Upvote 0
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?
 
Upvote 0
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.
 
Upvote 0
You need something like this

3de0b4a2c0a5d2915496bd7d6ebdb869.jpg

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

Forum statistics

Threads
1,223,891
Messages
6,175,229
Members
452,621
Latest member
Laura_PinksBTHFT

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