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

actjfc

Active Member
Joined
Jun 28, 2003
Messages
412
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!
 

Some videos you may like

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,911
Office Version
  1. 365
Platform
  1. Windows
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
 

Watch MrExcel Video

Forum statistics

Threads
1,111,490
Messages
5,541,028
Members
410,540
Latest member
FlaShow
Top