Applies To
Chart Object, DialogSheet Object, Worksheet Object.
Description
Accessor. Returns an object that represents a single text box (a TextBox object, Syntax 1) or a collection of text boxes (a TextBoxes object, Syntax 2) on the sheet. Read-only.
Syntax 1
object.TextBoxes(index)
Syntax 2
object.TextBoxes
object
Required. The object containing the text boxes.
index
Required for Syntax 1. The name or number of the text box.
Example
This example sets the text that appears in text box one on Sheet1.
Worksheets("Sheet1").TextBoxes(1).Caption = "Text Box One"
This example deletes all text boxes on Sheet1.
Worksheets("Sheet1").TextBoxes.Delete