Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Underline
I would like to apply underlining format to a cell where JUST the words are
underlined (the underlining does not extend accross the entire cell). It seems that it always just underlined the word when I pressed Ctrl-U, but lately Excel has been putting the underline accross the whole cell as if I had added a border. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Underline
Pressing Ctrl-U underlined the whole cell when I tried it. You can select
and underline each word in the cell individually but that would be very labour intensive if you have a lot of cells. Regards Trevor "Arun" wrote in message ... I would like to apply underlining format to a cell where JUST the words are underlined (the underlining does not extend accross the entire cell). It seems that it always just underlined the word when I pressed Ctrl-U, but lately Excel has been putting the underline accross the whole cell as if I had added a border. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Underline
Arun
Try this macro. Sub underline() Dim v As Variant, i As Integer If ActiveCell.HasFormula = False Then v = Selection(1, 1).Value For i = 1 To Len(v) If Not (Mid(v, i, 1)) = Chr(32) Then Selection(1, 1).Characters(Start:=i, _ Length:=1).Font.underline = True End If Next i End If End Sub Gord Dibben MS Excel MVP On Fri, 11 May 2007 21:13:00 -0700, Arun wrote: I would like to apply underlining format to a cell where JUST the words are underlined (the underlining does not extend accross the entire cell). It seems that it always just underlined the word when I pressed Ctrl-U, but lately Excel has been putting the underline accross the whole cell as if I had added a border. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Underline
Or if you just want to work with a single cell with
a text constant (no formula), you should do your selection on the address bar not in the cell. To work within the cell you must first use F2 to get into edit mode, but you are better off using the address bar. --- HTH, David McRitchie, Microsoft MVP - Excel My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Gord Dibben" <gorddibbATshawDOTca wrote in message ... Arun Try this macro. Sub underline() Dim v As Variant, i As Integer If ActiveCell.HasFormula = False Then v = Selection(1, 1).Value For i = 1 To Len(v) If Not (Mid(v, i, 1)) = Chr(32) Then Selection(1, 1).Characters(Start:=i, _ Length:=1).Font.underline = True End If Next i End If End Sub Gord Dibben MS Excel MVP On Fri, 11 May 2007 21:13:00 -0700, Arun wrote: I would like to apply underlining format to a cell where JUST the words are underlined (the underlining does not extend accross the entire cell). It seems that it always just underlined the word when I pressed Ctrl-U, but lately Excel has been putting the underline accross the whole cell as if I had added a border. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Underline % format | Excel Worksheet Functions | |||
underline | Excel Discussion (Misc queries) | |||
Borders nor underline commands remove an unusual underline. ?? | Excel Discussion (Misc queries) | |||
Underline | New Users to Excel | |||
How do I underline? | Excel Worksheet Functions |