Extracting from a cell only the "bold" text ...

actjfc

Active Member
Joined
Jun 28, 2003
Messages
416
Hello all,

I have a very long glossary one entry per cell, arranged in rows. Each cell has the term to be defined written in bold and located in the first few words. These few words may be one, two, three or more words (all in bold), followed by the actual term definition in regular non-bold text.

I would like to isolate in one column the terms that are being defined. So, I need a kind of Extract Function that only extracts those bold words that are located in the first (let's say) 10 words of the text within one single cell.

Can somebody help me to do that?

Thanks!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
The following UDF will extract all the bold characters at the start of the cell.
Code:
Function GetBold(rng As Range) As String
Dim I As Long
Dim X As Characters
    For I = 1 To Len(rng)
        Set X = rng.Characters(I, 1)
        If X.Font.Bold Then
            GetBold = GetBold & X.Text
        Else
            Exit For
        End If
    Next I
End Function
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,941
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