Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Can somebody tell me how to extract the characters in bold from the text in the cell?

  Asked By: Ava    Date: Oct 27    Category: MS Office    Views: 744
  

I have a number of cells on a worksheet which contain a mixture of bold and
normal type. Can somebody tell me how to extract the characters in bold from
the text in the cell.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Blaze Fischer     Answered On: Oct 27

Create a user defined function thus:

Function blah(OrigStr As Range)
blah = ""
For i = 1 To Len(OrigStr)
If OrigStr.Characters(i, 1).Font.Bold = True Then blah = blah &
Mid(OrigStr, i, 1)
Next
End Function

(The line beginning
If...
ends with
Mid(OrigStr, i, 1)

It may be split above.)

Example of use in worksheet:
=blah(B3)

 




Tagged: