Characters Font.Bold = True

Maurizio

Well-known Member
Joined
Oct 15, 2002
Messages
687
Office Version
  1. 2007
Platform
  1. Windows
Hi all,
how can I get BOLD only text into "(.......)"
8.xls
EFGH
1ArticleTrcblKg
2VITEL(VITELLO)B66269,306,80
3MEZZBXXX185,004,40
4BUSTIVTBXXX205,804,39
5VITEL(VITELLO)B662326,205,30
6COSCIOTVT(VITELLO)B64866,406,50
7COSCIOTMZSCV(MANZO)B63866,603,87
8MEZZ-12(MANZO)B657124,803,90
9VITEL(VITELLO)B656362,006,50
DaFatt


Tia.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Haluk

Rules Violation
Joined
Oct 26, 2002
Messages
1,075
Try this;

Code:
Sub Test()
    Dim MyRng As Range
    Dim NoE As Long
    Dim x As Integer
    NoE = Cells(65536, 5).End(xlUp).Row
        For Each MyRng In Range("E1:E" & NoE)
            x = InStr(MyRng, "(")
            If x > 0 Then
            MyRng.Characters(x + 1, Len(MyRng) - x - 1).Font.Bold = True
            End If
        Next
End Sub
 

Richie(UK)

MrExcel MVP
Joined
May 17, 2002
Messages
3,329
Hi Maurizio,

How about:
Code:
Sub ToBoldlyGo()
    Dim rngText As Range, rngCell As Range
    Dim lStart As Long, lEnd As Long
    
    Application.ScreenUpdating = False
    
    With ThisWorkbook.Worksheets("Sheet1")
        Set rngText = .Range("E2:E" & .Cells(.Rows.Count, "E").End(xlUp).Row) _
            .SpecialCells(xlCellTypeConstants, xlTextValues)
        For Each rngCell In rngText
            lStart = 0: lEnd = 0
            With rngCell
                lStart = InStr(1, .Text, "(")
                If lStart > 0 Then
                    lEnd = InStr(lStart, .Text, ")")
                    If lEnd > 0 Then
                        .Characters(Start:=lStart, Length:=lEnd + 1 - lStart) _
                            .Font.FontStyle = "Bold"
                    End If
                End If
            End With
        Next rngCell
    End With
    
    Application.ScreenUpdating = True
    
End Sub
HTH

Edit : Raider=TDQ! :)
 

Forum statistics

Threads
1,148,229
Messages
5,745,483
Members
423,953
Latest member
MrC54

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top