How could I set a Text Highlight Color—not cell shading—for a specific text within an Excel cell?

How could I set a Text Highlight Color—not cell shading—for a specific text within an Excel cell?


Illustrative Example:

This is a screenshot from OneNote of what I need to do on Excel also: link

#A: This cell has a shading color (grey) and there is not text hightlighted.

#B: this cell has a shading color (light blue) and word2,3 are higlighted with (green) (This is what I need to do)


Note:

What I mean by Text Highlight Color isn't related to a VBA or Macro scripts, I just mean the decorative meaning to style text manually.

1

4 Answers

I had this same issue but I couldn't use the Review Ink Tools method in the above answer because I had to automate the process in VBA.

My workaround was to create inline textboxes the height of the cell and to set the background of the textbox to the highlight color (or white) that I wanted, see picture below:

.

Here's my VBA code that produces these textboxes in the active cell for anyone that's interested. The textbox will automatically resize in width to fit the text:

' Create an inline textbox in the active cell and return it
Function InlineTextBox(s As String, rgb As Long, left As Integer) As Shape Set InlineTextBox = Worksheets(1).Shapes.AddTextbox(msoTextOrientationHorizontal, _ left, ActiveCell.Top, 50, 15) InlineTextBox.TextFrame.Characters.Text = s InlineTextBox.TextFrame2.WordWrap = False InlineTextBox.TextFrame.MarginLeft = 2 InlineTextBox.TextFrame.MarginRight = 0 InlineTextBox.TextFrame.MarginTop = 0 InlineTextBox.TextFrame.MarginBottom = 0 InlineTextBox.Line.Visible = msoFalse InlineTextBox.TextFrame2.AutoSize = msoAutoSizeShapeToFitText InlineTextBox.Height = 15 InlineTextBox.Fill.ForeColor.rgb = rgb
End Function

I'm sorry to say, text highlighting like you know it from Word or OneNote is not available in Excel and it never was.

If you are wondering why, every Office application has a different focus. In a similar way, you cannot insert calculation formulas into OneNote tables. I don't know whether you noticed it, but in OneNote you cannot even split or merge table cells, which is a pretty common thing in Word or Excel.

Just press F2 on that cell -- you've enter direct edit mode; then select characters using your mouse. Context popup appears in a moment where you can select color of your choice for selected amount of text. Hope this helps.

Excel text colorization

2

In Excel 2013 there is a feature called Inking where you can highlight text in a cell. This feature includes a pen, highlighter and an eraser (similar to Paint) with a limited selection of colors to choose from.

  1. Go to the REVIEW tab

    The last group is Ink.

  2. Click on the Start Inking icon

    A new INK TOOLS section appears with a PENS tab.

Requires a somewhat steady hand but as an alternative it works pretty good.

highlighted text in excel

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like