TextBoxes Collection Object

Description

A collection of all the TextBox objects (rectangles with text inside) on the specified chart sheet, dialog sheet, or worksheet.

Accessors

Use the Add method to create a new text box and add it to the collection. The following example creates a new text box on the worksheet named "Sheet1." The new text box is twice as wide and three times as high as cell C5; its upper-left corner is positioned at the upper-left corner of cell C5.


Dim r As Range
Set r = Worksheets("sheet1").Range("c5")
Worksheets("sheet1").TextBoxes.Add r.Left, r.Top, _
    2 * r.Width, 3 * r.Height

Use the TextBoxes method with an argument to access a single member of the collection or without an argument to access the entire collection at once. The following example deletes all of the text boxes on the worksheet named "Sheet1."


Worksheets("sheet1").TextBoxes.Delete

Properties

AddIndent Property, Application Property, AutoSize Property, Border Property, Caption Property, Count Property, Creator Property, Enabled Property, Font Property, Formula Property, Height Property, HorizontalAlignment Property, Interior Property, Left Property, Locked Property, LockedText Property, OnAction Property, Orientation Property, Parent Property, Placement Property, PrintObject Property, RoundedCorners Property, Shadow Property, Text Property, Top Property, VerticalAlignment Property, Visible Property, Width Property, ZOrder Property.

Methods

Add Method (Graphic Objects and Controls), BringToFront Method, Characters Method, CheckSpelling Method, Copy Method, CopyPicture Method, Cut Method, Delete Method, Duplicate Method, Group Method, Item Method, Select Method, SendToBack Method.