Email:      Pass:    Pass?
Close Window   
Free Ebook
Get Your Free Excel
Our Top 15 Excel Tutorials
Instant Access!
Subscribe for Free Excel tips & more!


Forum Register
Search Excel Forum Posts, Tutorials, Macros, Tips, and More

I am looking for information on inserting an underline. I do not want the
underline under just the number and I don't want the border option. I belive
there is a format option that will make a line that goes across the cell but
just short of the end of the cell edges. I would appreciate any ideas. I
have seen it before but cannot remember that options to format the line this

View Answers     

Similar Excel Tutorials

How to Find and Understand Excel Functions
In this tutorial I am going to show you how to find and understand new Excel Functions. If you go to the Formulas t ...
How to Find and Fix Errors in Complex Formulas in Excel
Here, I'll show you a quick, simple, and effective way to fix formulas and functions in Excel. It can be hard to f ...
How to Add Formatting to Cells and Data in Excel Styles, Fonts, Colors, & More
In this tutorial I will cover how to use the various formatting tools in Excel. The Formatting tools are located on ...

Helpful Excel Macros

Format Cells in The Short Date Number Format in Excel
- This free Excel macro applies the Short Date number format to a selection of cells in Excel. This number format display
Format Cells in The Number (Numerical) Number Format in Excel
- This free Excel macro formats selected cells in the Number or Numerical number format in Excel. This means that the cel
Format Cells as Time in Excel
- This free Excel macro formats a selection of cells in the Time format in Excel. This Time number format means that inst
Format Cells as a Scientific Number in Excel Number Formatting
- This free Excel macro formats selected cells in the Scientific number format in Excel. This means the cell will be put
Format Cells as a Fraction in Excel Number Formatting
- This free Excel macro will automatically format a selected cell or many selected cells in the Fraction number format in

Similar Topics

How do I format a cell underline to extend almost the entire width of a cell but not all the way to the edge? (i.e. I'd like an underline longer than simply ctrl + U, but less than entire border underline). Thanks!

I need to format 3 lines of text within the same cell with different styles.

line 1

I am doing this in C# and I tried the following:

Range.Font.Underline = true;
Range.Value2 = "line 1";
Range.Font.Underline = false;
Range.Font.Bold = true;
Range.Value2 = Range.Value2 + "line 2";

The problem lies within the concatenation of "line 2" to "line 1". Since I turned off underline after line 1 and turned on bold, the concatenation reformats the value to bold, and "line 1" is no longer underlined.

Anyeone have any ideas as to how to retain the underline for "line 1"?

There is a short cut to underline word by choosing pictuorial U. How about to
underline a word that the line is by dot ?

I wish the line same as the word length and not by drawing.


Any suggestions on overlining a cell contents so it can match up with the
underline in Accouting format. Do not want to do borders because it defeats
the purpose of Accounting format underline. I want to apply formatting to
the cell itself rather than doing an underline in cell above it.

Is it possible to underline text with differenet color?

Text is let say std. black, and need red underline.

(I can change color of cell down but I would like underline line in right test test.


Everytime I open a new file, there is a predetermined underline for Row 1. It is not the border, because even if I eliminate that, there is a distinctive underline remaining. It is almost as if it is pre-destined to be a header row. Normally, I like it, but in some cases I don't want a header row. If I delete Row 1, everything moves up, but Row 1 stays underlined. Any thoughts?

I am trying to add a double underline into a specific row (Cell "A" & row). The row can change so I cannot code the position. Initially I had the text coded with a double underline, but my user wants some space between the text and the underline, which led me to try using the shape object. How would I change the following code:


With Sheets(shtRpt).Shapes.AddLine(0, 100, 132, 100).Line
                .Style = msoLineThinThin
                .Weight = 3#
            End With



I am hoping someone can assist me. I'm fairly new to VBA and need the following done:
I have several sheets which have conditional formatting that underlines names which match the sheet name (e.g. "John" and "Mary") When I group the sheets into a "master" sheet, I would like the underline format to remain to indicate the original source sheets At present, the underline is lost as the conditional format recognises the "master" sheet name than the original sourced sheet names Is there a way to retain the underline format without underlining the relevant cells manually? Help!

I have a worksheet that has a subject listed for each month of the year by
weeks. My question is how do I under line the last week of every month
completely across the columns? I can underline by each word separately but
want the whole thing underlined. Also when I have a line in BOLD that has to
been underlined and I have narrowed the row space, it seems the underline
causes the top of the letters in the BOLD row to be cut off. So guess I have
two separate questions needed to be answered.

I have a value (numeric) in cell A1.

Then in cell B1, I have the follwoing formula:

="The result is"&A1.

So if I have a number 50 in A1, B1 will look like:

The result is 50.

How do I make that

The result is 50.


I reckon I need to use the TEXT(REF,FORMAT) function but I do not know how to express the UNDERLINE format in the custom formatting.


My spreadsheet contains an unusual underline that I cannot remove.
Neither the Borders or the Underline commands remove it.
It is not the dotted line subscribing a page to be printed.
I'm stumped.


I am trying to write a custom cell format that would allow me to replace the comma with a space after the thousand's place. Therefore, 1 million would look like: 1 000 000 instead of 1,000,000. I do NOT want to change my regional settings to accomplish this.

When I write ### ### ### it accomplishes this, however, there is one small glitch. When you apply an "underline" you get the following result:

_1 000
_10 000
_100 000
1 000 000
10 000 000
100 000 000

The underline does not lineup evenly with the "ones" digit until we reach 1 million. I want to write a universal format in which the underline lines up evenly regardless of the number.

Does anyone know how to fix this?

Thanks in advance,

Hi all

For some reason (and I have searched and searched) I can't find an option in Excel 2003 to underline misspelt words with a red line.

Can someone stop me losing my mind and point it out.

I bet after all this its as obvious as hell



So basically I'm trying to pull formatting from 1 cell to another(automatically updating as well). (format being font color and underline). I know this will not work with the normal excel formulas so I've been playing with VBA.

To test this I have a worksheet where B1's text is underlined. In cell C1 I'm running this:

=uline(B2, B1)

which runs this function

Function uline(CurCell As Range, LookupTable As Range)
    uline = ""
    For Each Access_Cell In LookupTable
        If Access_Cell.Font.Underline = xlUnderlineStyleSingle Then
            CurCell.Font.Underline = xlUnderlineStyleSingle
            CurCell.Font.Color = RGB(255, 0, 0)
        End If
    Next Access_Cell
End Function

Right now the if statement is only detecting underline to make sure it works. The color part works - it will color the "CurCell" if the "LookupTable" is underlined, but after much painstaking trial runs I cannot get it to change the underline value. I tried for a while to call the function in the cell that I wanted to underline (by having a string as a parameter and then spitting it back out at the end) but same problem with no underline.

Is there a way to do this? I need the cell's format to update automatically if the referencing cell's format changes. And I'm pretty sure I need to pass the ranges as parameters as in the real case I'll be accessing data on another worksheet.
A macro might work as the cell won't update unless I click on the formula cell and then press enter. Is there a way to pass range parameters to a macro though?

I'd appreciate any help! thanks!


I've found an interesting (and very annoying) trait of excel and wondering if it is a bug or whether I'm doing something odd.

Relates to Excel 2002 - SP3

Basically I have text in a cell at font size 11. This text is made up two or more sentences each split with ALT-RETURNS.

The first sentence is then formated with UNDERLINE.

All good thus far.

Each month this gets updated and I've set up a routine to copy/paste special-values over the top.

Excel decides to format the whole cell with UNDERLINE. So I have to go through each, highlight everything bar the first sentence and remove UNDERLINE.

Excel then decides to change the font size from 11 to 6.5 on all text I've removed the UNDERLINE from.

Any thoughts?



I've been doing alot of research for the past week on this topic and came up with top two answers .
1. you cant do it
2. you can do it but only if it is broken up.
3. find another option.

lets say i want to do this.

and have been trying really hard to find en number of ways.

code 1 by pgc01
Private Sub Worksheet_Change(ByVal Target As Range)
Dim s1 As String, s2 As String

' only if D1 changes
If Target.Address "$D$1" Then Exit Sub

' write the text in A1
s1 = " The Agreement between (The ""Company"") and "
s2 = " (The ""Customer"")"
Range("A1") = s1 & Range("D1") & s2

' add underline to the format of the words "Company" and "Customer"
Range("A1").Characters(InStr(1, Range("A1"), "Company", vbTextCompare), Len("Company")).Font.Underline = True
Range("A1").Characters(InStr(1, Range("A1"), "Customer", vbTextCompare), Len("Customer")).Font.Underline = True

End Sub

(i have been hopping)
code 2 from
Function CopyNumberWithOneUnderlinedCharacter(ByVal myCell As Range)
Dim l_Position As Integer
For l_Position = 1 To Len(myCell.Value)
If myCell.Characters(Start:=l_Position, Length:=1).Font.Underline _
xlUnderlineStyleNone Then

CopyNumberWithOneUnderlinedCharacter.Characters(St art:=l_Position,
Length:=1).Font.Underline = xlUnderlineStyleSingle
End If
Next l_Position
End Function
therse were the best two answers i could find out for underlineing a part of a sentence in a cell.

now my question here is for some one who can put up a function for a sell only or formatting.

for example
A1 = The
B1 = Cow
C1 = jumped
D1 = over
E1 = the
F1 = moon.

lets say my data is like this. if i really want to join the sentense all i have to do is "=A1&B1&C1&D1&E1&F1" (without quots)

can someone come up with a function to underline just 1 cell

hypothetically C1

thus bringing me to a formula
"=A1&B1&underline(C1)&D1&E1&F1" (without quots)

ideally this should be the case isnt it ?

Any suggestions on how to go about this.... i've just theorized the theory.

Some one help me put this in motion.

Is there any way, simple or otherwise, to create an overline?

For example, have the length of the underline of the cell based on a the number of characters in the cell below it as in a total.

instead of:


Thanks a million. mikeburg

Is there any way, simple or otherwise, to create an overline?

For example, have the length of the underline of the cell based on a the number of characters in the cell below it as in a total.

instead of:


Thanks a million. mikeburg

Hi Guys,

Attached is a test spreadsheet I am trying to tweak. Column B contains dates of courses starting and I have to currently manually add a Thick underline border to make different days stand out more.

What I wanted to know is there a way to make a macro that will automatically search column B and when it finds two dates it will automatically underline a thick line from Columns A all the way to Column I so that I don't have to constantly manually add them when new dates are added.

If anyone out there can help me in my plight then I would be eternally grateful.

Thanks in advance.


When I am creating a spread sheet I sometimes use the bold and underline features for the headings. Sometimes when I change from one cell to another using the left and right arrow keys I find the bold and underline features are also being selected, even though I don't want to use them anymore. Is there a way to stop this happening, it is driving me crazy.

Thanks, Mickmac


When I am creating a spread sheet I sometimes use the bold and underline features for the headings. Sometimes when I change from one cell to another using the left and right arrow keys I find the bold and underline features are also being selected, even though I don't want to use them anymore. Is there a way to stop this happening, it is driving me crazy.

Thanks, Mickmac


Cells A1 to A5 have :
1 xyz 2 xyz 3 xyz 4 abc 5 abc 6 def
I would like to underline rows 3, 5 and 6 (that is before the value in A changes to the next value).

Also if possible, to clear the underlines in prior rows - that is if row 2 has an underline that should be cleared and only row 3 to be undelined.

Can anybody help with a simple macro ? Appreciate your time...


Hello, my name is Iara. I joined this forum because i have one question that i havent been able to find the answer by google ....(by the way, sorry for my english) ... the question is, why does excel no underline in a red curve line the misspelled words??? (like Word would)

Thank you!

I have a series of cells in a column and I would like to programatically add an underline each time there is a break in the cell value. For example,


Any ideas?


I'm not sure if I'm posting this to the correct newsgroup or not, so feel
free to redirect me to the appropriate place if necessary. At any rate, I am
receiving the error, "Unable to set the underline property of the font class"
in an Access module using the Excel code below:

ExcelSheet.Application.Cells(1, 1).Font.Underline = xlUnderlineStyleSingle

The following line of code "does" work, however:

ExcelSheet.Application.Cells(1, 1).Font.Bold = True

Do you see anything wrong with the way I am attempting to set the underline
property? Thanks in advance!