Applies To
Buttons Collection, ChartObjects Collection, EditBoxes Collection, GroupBoxes Collection, Labels Collection, ListBoxes Collection, OptionButtons Collection, Ovals Collection, Pictures Collection, Rectangles Collection, ScrollBars Collection, Spinners Collection, TextBoxes Collection.
Description
Creates a new graphic object or control using coordinates specified in points (1/72 inch).
The type of the object depends on the collection on which you call Add. For example, Rectangles.Add creates a new rectangle; Ovals.Add creates a new oval.
Syntax
object.Add(left, top, width, height)
object
Required. The object to which this method applies.
left, top
Required. Specifies the initial coordinates of the new object, in points (1/72 inch), relative to the top left corner of cell A1 on a worksheet, or to the upper left corner of a chart.
width, height
Required. Specifies the initial size of the new object, in points (1/72 inch).
Remarks
The specified coordinates describe the new object's bounding rectangle. The object fills the bounding rectangle.
See Also
Add Method (Arcs and Lines), Add Method (Drawings Collection), Add Method (DropDowns Collection), Duplicate Method.
Example
This example creates a new oval on Sheet1. The oval is aligned with and the same size as cell D3.
Set myCell = ActiveWorkbook.Worksheets("Sheet1").Range("D3") ActiveWorkbook.Worksheets("Sheet1").Ovals.Add _ Top:=myCell.Top, Left:=myCell.Left, _ Height:=myCell.Height, Width:=myCell.Width