ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Underline and Bold 4th numeral (https://www.excelbanter.com/excel-programming/419951-underline-bold-4th-numeral.html)

Steved

Underline and Bold 4th numeral
 
Hello from Steved

all cells in column C

3547

How does one underline and bold the 4th numeral in this case 7 please.

Thankyou.

Bernie Deitrick

Underline and Bold 4th numeral
 
Steve,

If you can live with the cells formatted as strings:

Sub Macro1()
Dim myS As String
Dim myC As Range

For Each myC In Intersect(ActiveSheet.UsedRange, Range("C:C"))
myS = myC.Value
myC.NumberFormat = "@"
myC.Value = myS
With myC.Characters(Start:=4, Length:=1).Font
.FontStyle = "Bold"
.Underline = xlUnderlineStyleSingle
End With
Next myC
End Sub

Otherwise, the formatting won't take.

HTH,
Bernie
MS Excel MVP



"Steved" wrote in message
...
Hello from Steved

all cells in column C

3547

How does one underline and bold the 4th numeral in this case 7 please.

Thankyou.




Per Jessen[_2_]

Underline and Bold 4th numeral
 
Hello Steved

Assuming you always want the 4th numeral bolded and underlined try
this:

Sub Test()
Application.ScreenUpdating = False
Columns("C").Select
For Each cell In Selection

With cell.Characters(Start:=4, Length:=1).Font
.FontStyle = "Bold"
.Underline = xlUnderlineStyleSingle
End With
Next
Application.ScreenUpdating = True
End Sub

Regards,
Per

On 13 Nov., 02:50, Steved wrote:
Hello from Steved

all cells in column C

3547

How does one underline and bold the 4th numeral in this case 7 please.

Thankyou.



Steved

Underline and Bold 4th numeral
 
Thankyou.

"Per Jessen" wrote:

Hello Steved

Assuming you always want the 4th numeral bolded and underlined try
this:

Sub Test()
Application.ScreenUpdating = False
Columns("C").Select
For Each cell In Selection

With cell.Characters(Start:=4, Length:=1).Font
.FontStyle = "Bold"
.Underline = xlUnderlineStyleSingle
End With
Next
Application.ScreenUpdating = True
End Sub

Regards,
Per

On 13 Nov., 02:50, Steved wrote:
Hello from Steved

all cells in column C

3547

How does one underline and bold the 4th numeral in this case 7 please.

Thankyou.





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com