Characters Object [Excel 2003 VBA Language Reference]

Multiple objects

Represents characters in an object that contains text. The Characters object lets you modify any sequence of characters contained in the full text string.

Using the Characters Object

Use Characters(start, length), where start is the start character number and length is the number of characters, to return a Characters object. The following example adds text to cell B1 and then makes the second word bold.

With Worksheets("Sheet1").Range("B1")
    .Value = "New Title"
    .Characters(5, 5).Font.Bold = True
End With


The Characters method is necessary only when you need to change some of an object's text without affecting the rest (you cannot use the Characters method to format a portion of the text if the object doesn't support rich text). To change all the text at the same time, you can usually apply the appropriate method or property directly to the object. The following example formats the contents of cell A5 as italic.

Worksheets("Sheet1").Range("A5").Font.Italic = True

Properties | Application Property | Caption Property | Count Property | Creator Property | Font Property | Parent Property | PhoneticCharacters Property | Text Property

Methods | Delete Method | Insert Method

Parent Objects | AxisTitle Object | ChartTitle Object | DataLabel Object | DisplayUnitLabel Object | Range Collection

Child Objects | Font Object