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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find out if part of text in a cell is formatted differently

Status
Not open for further replies.

IFK

MIS
Jun 6, 2003
12
DE
Hello,

I need to find out via VB and Excel objects if some part of text in a range (my range = one cell) is formatted.

E.g. the text = "This is a TEST"

In this case I need to know that TEST is bold.

Is there a way to do that?

Thanks a lot,
IFK
 
IFK,

You have to look at each character in the cell
Code:
    For i = 1 To ActiveCell.Characters.Count
      If ActiveCell.Characters(Start:=i, Length:=1).Font.Bold Then
        MsgBox ActiveCell.Characters(Start:=i, Length:=1).Text
      End If
    Next
:)


Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top