Add Method (Charts Collection)

Applies To

Charts collection object.

Description

Creates a new chart sheet. Returns a Chart object.

Syntax

expression.Add(Before, After, Count)

expression Required. An expression that returns a Charts object.

Before Optional Variant. An object that specifies the sheet before which the new sheet is added.

After Optional Variant. An object that specifies the sheet after which the new sheet is added.

Count Optional Variant. The number of sheets to be added. The default value is one.

Remarks

If Before and After are both omitted, the new chart is inserted before the active sheet.

Example

This example creates an empty chart sheet and inserts it before the last worksheet.

ActiveWorkbook.Charts.Add Before:=Worksheets(Worksheets.Count)