Name
chart.Add([Before], [After], [Count])
Synopsis
Creates one or more chart sheets and returns a reference to the first Chart object created.
|
Argument |
Settings |
|---|---|
|
|
The sheet in the workbook before which the new chart sheet is placed. |
|
|
The sheet in the workbook after which the new chart sheet is placed. |
|
|
The number of chart sheets to add. Default is 1. |
You can’t specify both the Before and After arguments; you must choose one. The following code creates three new chart sheets at the beginning of a workbook and names the first sheet New Chart:
Sub AddCharts( )
Dim chrt As Chart
Set chrt = Charts.Add(Sheets(1), , 3)
chrt.Name = "New Chart"
End SubThe other two charts receive default names (Chart
n).
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access