On Sun, 10 Sep 2006 15:58:01 -0700, Luong Vinh Tu <Luong Vinh
I have a text in a cell
Barcelona vs Osasuna ("Barcelona" is bold)
Now I want to chose the text "Barcelona"
How to do this ?
Thanks
Not sure what you mean when you write "chose the text".
If you want to select it, double click in the cell and drag the cursor across
the bold letters. You can then copy it and paste it elsewhere.
If you want a function to return all of the bolded text in a cell as the
result, then you will need to use a VBA function.
<alt><F11> opens the VB Editor.
Ensure your project is highlighted in the project explorer window, then
Insert/Module and paste the code below into the window that opens.
To use the function (UDF), enter a formula into some cell in the form:
=SelBold(cell_ref)
where cell_ref is the cell containing your partially bolded string.
============================================
Option Explicit
Function SelBold(rg As Range) As String
Dim i As Long
For i = 1 To Len(rg.Text)
If rg.Characters(i, 1).Font.Bold = True Then
SelBold = SelBold & Mid(rg.Text, i, 1)
End If
Next i
End Function
============================
--ron