Rectangles Collection Object

Description

A collection of all the Rectangle objects on the specified chart sheet, dialog sheet, or worksheet.

Accessors

Use the Add method to create a new rectangle and add it to the collection. The following example adds a new rectangle to the worksheet named "Sheet1." The new rectangle is 200 points high and 100 points wide, and its upper-left corner is positioned at the upper-left corner of cell C5.


Set r = Worksheets("sheet1").Range("c5")
Worksheets("sheet1").Rectangles.Add r.Left, r.Top, 200, 100

Use the Rectangles 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 rectangles on the worksheet named "Sheet1."


Worksheets("sheet1").Rectangles.Delete

Properties

Application Property, Border Property, Count Property, Creator Property, Enabled Property, Height Property, Interior Property, Left Property, Locked Property, OnAction Property, Parent Property, Placement Property, PrintObject Property, RoundedCorners Property, Shadow Property, Top Property, Visible Property, Width Property, ZOrder Property.

Methods

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