Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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
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
Using TEXT and &TEXT - display numbers with commas, underline text Gary Excel Discussion (Misc queries) 3 May 5th 23 03:46 AM
underline too close to text MAB Excel Worksheet Functions 2 December 7th 07 08:24 PM
Underline Text only Rawle Excel Discussion (Misc queries) 3 August 30th 07 02:45 PM
Is there a way to underline by clicking on text? atsd Excel Discussion (Misc queries) 2 March 19th 06 10:12 PM
Selecting cells that contain text in a specific format nicad_adam Excel Discussion (Misc queries) 1 June 17th 05 05:19 AM


All times are GMT +1. The time now is 04:06 PM.

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"