Characters Object

Description

Represents characters in an object containing text. The Characters object lets you access any sequence of characters contained in the full text string.

Accessors

Use the Characters method to return a subset of sequential characters in the text. The following example adds text to cell B1 on the worksheet named "Sheet1" and then makes the second word bold.


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

Remarks

The Characters method is necessary only when you need to change some of the text contained in an object without affecting the rest (you cannot use the Characters method to format a portion of the text if the object does not support rich text). To change all the text at once, you can usually apply the appropriate method or property directly to the object. The following example sets the contents of cell A5 on the worksheet named "Sheet1" to italic.


Worksheets("sheet1").Range("a5").Font.Italic = True

Properties

Application Property, Caption Property, Count Property, Creator Property, Font Property, Parent Property, Text Property.

Methods

Delete Method, Insert Method.