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

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
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
 
Upvote 0
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! :)
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,272
Members
448,558
Latest member
aivin

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
Back
Top