How to bold partial text string for over 600 rows

Jongo1

New Member
Joined
Aug 8, 2016
Messages
24
I have in column B non-duplicate information and I need to bold over 600 lines in the manner below.

WGHI(Studio)(Los Angeles, Cali) Radio (Nov 1, 2017) - Top 10 Radio Station
KAWG (CNBC)(NY, New York) Television (Nov 2, 2017) - Top 10 TV

and so on and so on for 600 rows what I need is

WGHI(Studio)(Los Angeles, Cali) Radio (Nov 1, 2017) - Top 10 radio station
KAWG (CNBC)(NY, New York) Television (Nov 2, 2017) - Top 5 TV

is this possible?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
If your rows always contain at least 3 parens ((( and you want it to bold everything up to the 3rd open paren, then the following will work. Run the doboldstring macro.

Code:
Option Explicit
Function Meds(S As String) As String
    Dim S1 As Variant, S2 As Variant


S1 = Split(S, "\")
S2 = Split(S1(UBound(S1)), "(")
ReDim Preserve S2(0 To 2)
Meds = Join(S2, "-")


End Function
Sub doboldstring()
Dim lastrow, x, parens, strlen As Long


lastrow = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
For x = 1 To lastrow
parens = UBound(Split(Cells(x, "B"), "("))
If parens >= 3 Then
strlen = Len(Meds(Cells(x, "B")))
With Cells(x, "B").Characters(Start:=1, Length:=strlen).Font
                .FontStyle = "Bold"
    End With
End If
Next x
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,162
Messages
6,170,432
Members
452,326
Latest member
johnshaji

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