Rectangle Object

Description

Represents a rectangle graphic object on a chart sheet, dialog sheet, or worksheet.

Accessors

The Rectangle object is a member of the Rectangles collection. The Rectangles collection contains all the Rectangle objects on a single sheet. Use the Add method to create a new rectangle and add it to the collection.

To access a single member of the collection, use the Rectangles method with the index number or name of the rectangle as an argument.

The following example sets the interior color for rectangle one on the worksheet named "Sheet1."


Worksheets("sheet1").Rectangles(1).Interior.ColorIndex = 5

The rectangle name is shown in the Name Box when the rectangle is selected. Use the Name property to set or return the rectangle name. The following example sets the border line style for the rectangle named "Rectangle 3."


Worksheets("sheet1").Rectangles("rectangle 3"). _
    Border.LineStyle = xlDash

Properties

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

Methods

BringToFront Method, Copy Method, CopyPicture Method, Cut Method, Delete Method, Duplicate Method, Select Method, SendToBack Method.