Skip to content

Latest commit

 

History

History
64 lines (43 loc) · 1.91 KB

Excel.Characters.md

File metadata and controls

64 lines (43 loc) · 1.91 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Characters object (Excel)
vbaxl10.chm251072
vbaxl10.chm251072
Excel.Characters
128c9ee4-8ba3-6d22-ad0f-9f20be1e24af
03/29/2019
medium

Characters object (Excel)

Represents characters in an object that contains text.

Remarks

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

Use Characters (start, length), where start is the start character number and length is the number of characters, to return a Characters object.

Example

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 property of the Range object is necessary only when you need to change some of an object's text without affecting the rest (you cannot use the Characters property 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

Methods

Properties

See also

[!includeSupport and feedback]