#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 103
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,089
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 903
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Underline % format Will Fleenor Excel Worksheet Functions 5 June 19th 13 11:18 PM
underline TQ Excel Discussion (Misc queries) 3 August 21st 06 04:37 AM
Borders nor underline commands remove an unusual underline. ?? VideoFreak Excel Discussion (Misc queries) 4 February 11th 06 08:17 PM
Underline Carole Drake New Users to Excel 10 April 25th 05 07:09 PM
How do I underline? thumper Excel Worksheet Functions 1 February 10th 05 05:46 PM


All times are GMT +1. The time now is 12:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"