Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Underlining Text in Cells.

Underlining Text in Cells

by Allen Wyatt
(last updated April 28, 2021)

6

Everyone knows that you can underline text by simply selecting what you want underlined and then clicking on the Underline tool on the ribbon or toolbar. This adds a single underline. If you want a double underline, you must display the Home tab of the ribbon and use the down-arrow at the right of the Underline tool.

If you want any fancier underlines, it really helps to display the Font tab of the Format Cells dialog box. You do this by displaying the Home tab of the ribbon and clicking the small icon at the bottom-right of the Font group.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (6610) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Underlining Text in Cells.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Duplicate Workbooks Opening

If you ever open a workbook and always see two workbooks instead of one, chances are good the reason is because of the ...

Discover More

Remembering Workbook Position and Size

Want Excel to remember where your workbooks were located on the screen and then open them in the same position the next ...

Discover More

Getting Input from a Text File

You can use a macro to read information from a text file. The steps are easy, and then you can use that information in ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Differentiating a Header Row

When you use the sorting tool, Excel tries to automatically figure out if your data includes a header row or not. Here ...

Discover More

Moving Custom Formats to Number Formatting Categories

Moving your custom formats into a formatting category other than "custom" isn't something you can do in Excel. Here's ...

Discover More

Shortcut Key for Format Painter

The Format Painter is great for copying formatting from one cell to another. If you don't want to grab the mouse to use ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 7 + 4?

2021-04-28 05:13:13

Willy Vanhaelen

@Peter Atherton
This macro can be a lot shorter:

Sub UnderlineDate()
[a1] = "For the month ending " & DateSerial(Year([f1]), Month([f1]) + 1, 0)
[a1].Characters(22, 10).Font.Underline = True
End Sub


2019-08-19 10:00:43

Peter Atherton

Hector
If you do not mind a macro, this will enter the text in A1 and underline it. It uses the EOMONTH function to calculate the date of today's date but yo can reset it to F79

Sub UnderlineDate()
Dim txt As String
Dim dte As Date
txt = "For the month ending "
dte = [f1]
dte = Application.EoMonth(dte, 0)
[a2] = txt & dte
Dim L As Integer
L = Len([a1])

[a1].Characters(22, 10).Font.Underline = True
End Sub


2019-08-17 05:28:58

Steve Jez

Hector,
If the heading is on the worksheet & not a printing header, is it possible to split your header over 2 cells. "For the month ending: " in one cell right aligned and then your date formula in the adjacent cell to the right & left align it & underline ?


2019-08-16 15:25:39

hector

hey!

I need to present this heading " For the Month ending: 8/31/2019". This will be a calculated date. I NEED to underscore JUST the calculated date.

I already have the calculated date in cells F79 & G78 respectively and have this function there: ="For the month ending: " & F79 & " of " & G78

MY QUESTION IS: HOW CAN I MANAGE TO HAVE JUST THE DATE UNDERSCORED????

or how can i recall the CTRL-U within my formula??)


2017-10-24 09:17:22

Rusty Chiles

Note, a much quicker shortcut to opening the Format Cells box is to push 'Ctrl+1'


2017-10-23 09:34:49

Bryan Marks

You may want to add that you can also underline just part of the text--for example, a single word--in a cell. This is also true if you want to bold, italicize, and/or change the color of specific text in a cell.

For a cell that already has text in it, this can be accomplished by hitting F2 or double-clicking on the cell to edit it. Select the word or words you wish to modify, then either select the appropriate function from the toolbar (e.g., underline, bold, italics, color) or the short cuts such as Ctrl+U, Ctrl+B, or Ctrl+I to modify the text, then exit the cell.

If the cell is blank, simply start typing and use the above options to modify the text as desired, then exit the cell.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.