Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting text in cells & half of the Selected Text to be underLine
Hai,
I am trying to figure this out that it there any code that would be avaliable that can help to select the text in the defined cell & make The half of the selected text to be undeline in a selected Cell ? Bye Manish Singh |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting text in cells & half of the Selected Text to be underLine
Hi,
You need to use ActiveCell's Characters class. following macros will help you. Sub FirstHalfUnderLineCell() With ActiveCell .Characters(Start:=1, Length:=WorksheetFunction.RoundUp(Len(.Value) / 2, _ 0)).Font.Underline = xlUnderlineStyleSingle End With End Sub Sub SecondHalfUnderLineCell() With ActiveCell .Characters(Start:=WorksheetFunction.RoundUp(Len(. Value) / 2, 0), _ Length:=(Len(.Value) - WorksheetFunction.RoundUp(Len(.Value) / 2, _ 0) + 1)).Font.Underline = xlUnderlineStyleSingle End With End Sub Kind Regards -- Haldun Alay "Manish Singh" , haber iletisinde sunlari . com... Hai, I am trying to figure this out that it there any code that would be avaliable that can help to select the text in the defined cell & make The half of the selected text to be undeline in a selected Cell ? Bye Manish Singh |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting text in cells & half of the Selected Text to be underLine
Hi,
I tried the code u give but it's doen't help at all, is ther any way as I am using the vb & I have to make the Text in the Cell(1,1) to be let the text in the cell be is "Ref No: 23456" , where the 2456 is to be underline while the Ref No remain the same as it is? "Haldun Alay" wrote in message ... Hi, You need to use ActiveCell's Characters class. following macros will help you. Sub FirstHalfUnderLineCell() With ActiveCell .Characters(Start:=1, Length:=WorksheetFunction.RoundUp(Len(.Value) / 2, 0)).Font.Underline = xlUnderlineStyleSingle End With End Sub Sub SecondHalfUnderLineCell() With ActiveCell .Characters(Start:=WorksheetFunction.RoundUp(Len(. Value) / 2, 0), Length:=(Len(.Value) - WorksheetFunction.RoundUp(Len(.Value) / 2, 0) + 1)).Font.Underline = xlUnderlineStyleSingle End With End Sub Kind Regards -- Haldun Alay "Manish Singh" <dost , haber iletisinde sunlari . com... Hai, I am trying to figure this out that it there any code that would be avaliable that can help to select the text in the defined cell & make The half of the selected text to be undeline in a selected Cell ? Bye Manish Singh -- |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting text in cells & half of the Selected Text to be underLine
Hi,
"Ref No: 23456" Now it is more clear... Use this macro. Sub UnderLineCell() Const StartPos = 8 ' Length of "Ref No: " With ActiveCell .Characters(Start:=StartPos + 1, _ Length:=(Len( _ .Value) - StartPos)).Font _ .Underline = xlUnderlineStyleSingle End With End Sub Kind regards. -- Haldun Alay "Manish Singh" , haber iletisinde sunlari . com... Hi, I tried the code u give but it's doen't help at all, is ther any way as I am using the vb & I have to make the Text in the Cell(1,1) to be let the text in the cell be is "Ref No: 23456" , where the 2456 is to be underline while the Ref No remain the same as it is? "Haldun Alay" wrote in message ... Hi, You need to use ActiveCell's Characters class. following macros will help you. Sub FirstHalfUnderLineCell() With ActiveCell .Characters(Start:=1, Length:=WorksheetFunction.RoundUp(Len(.Value) / 2, 0)).Font.Underline = xlUnderlineStyleSingle End With End Sub Sub SecondHalfUnderLineCell() With ActiveCell .Characters(Start:=WorksheetFunction.RoundUp(Len(. Value) / 2, 0), Length:=(Len(.Value) - WorksheetFunction.RoundUp(Len(.Value) / 2, 0) + 1)).Font.Underline = xlUnderlineStyleSingle End With End Sub Kind Regards -- Haldun Alay "Manish Singh" <dost , haber iletisinde sunlari . com... Hai, I am trying to figure this out that it there any code that would be avaliable that can help to select the text in the defined cell & make The half of the selected text to be undeline in a selected Cell ? Bye Manish Singh -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using TEXT and &TEXT - display numbers with commas, underline text | Excel Discussion (Misc queries) | |||
underline too close to text | Excel Worksheet Functions | |||
Underline Text only | Excel Discussion (Misc queries) | |||
Is there a way to underline by clicking on text? | Excel Discussion (Misc queries) | |||
Selecting cells that contain text in a specific format | Excel Discussion (Misc queries) |