Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find bold part of cell value 1

Status
Not open for further replies.

chandlm

Programmer
Feb 11, 2003
114
GB
Hi Guys,

Using excel,I have the following value in cell A1:

"this is not bold this is bold"

What I need to do is to remove the part of the text that is bold and display it in cell B1

Not too sure if this is possible but would appreciate any help with this.

Thanks in advance,

Matt
[rockband]
 
Here is one way, using User Defined Functions (UDF):
[blue]
Code:
Option Explicit

Function BoldText(Ref As Range)
Dim i As Integer
  BoldText = ""
  With Ref
    For i = 1 To .Characters.Count
      If .Characters(i, 1).Font.Bold = True Then
        BoldText = BoldText + .Characters(i, 1).Text
      End If
    Next i
  End With
End Function

Function RegularText(Ref As Range)
Dim i As Integer
  RegularText = ""
  With Ref
    For i = 1 To .Characters.Count
      If .Characters(i, 1).Font.FontStyle = "Regular" Then
        RegularText = RegularText + .Characters(i, 1).Text
      End If
    Next i
  End With
End Function
[/color]

 
Zathras,

A star for your effort. Just what I was after.

Thanks



Matt
[rockband]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top