Deleting only bold text in a cell

FrankB

New Member
Joined
Sep 3, 2002
Messages
31
Is there a way to automate that? My cells have bold and normal font, and I would like to delete all the bold text.

Thanks,

Frank
 
Hi FrankB,

Here is an similar piece of code.
Code:
Sub RemoveBold()
    Dim rngTemp As Range
    Dim intPos As Integer
    Dim strTemp As String
    
    For Each rngTemp In Selection
        strTemp = rngTemp.Text
        For intPos = Len(strTemp) To 2 Step -1
            If rngTemp.Characters(intPos, 1).Font.Bold Then
                strTemp = Left(strTemp, intPos - 1) & Mid(strTemp, intPos + 1)
            End If
        Next
        If rngTemp.Characters(1, 1).Font.Bold Then strTemp = Mid(strTemp, 2)
        rngTemp = strTemp
        rngTemp.Font.Bold = False
    Next
End Sub

Just a note of caution. Both routines will remove all additional formatting that you have in a cell.

Cheers
Andy
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,215,062
Messages
6,122,925
Members
449,094
Latest member
teemeren

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