Microsoft Office Tutorials and References
In Depth Information
21.15.1 Adding a New Series
ApplyCustomType
Explosion
MarkerSize
ApplyDataLabels
Fill
MarkerStyle
ApplyPictToEnd
Formula
Name
ApplyPictToFront
FormulaLocal
Parent
ApplyPictToSides
FormulaR1C1
Paste
AxisGroup
FormulaR1C1Local
PictureType
BarShape
Has3DEffect
PictureUnit
Border
HasDataLabels
PlotOrder
BubbleSizes
HasErrorBars
Points
ChartType
HasLeaderLines
Select
ClearFormats
Interior
Shadow
Copy
InvertIfNegative
Smooth
Creator
LeaderLines
Trendlines
DataLabels
MarkerBackgroundColor
Type
Delete
MarkerBackgroundColorIndex
Values
ErrorBar
MarkerForegroundColor
XValues
21.15.1 Adding a New Series
To add a new series to a chart, we use the Add method of the SeriesCollection object. The syntax
is:
SeriesCollectionObject.Add(Source, Rowcol, _
SeriesLabels, CategoryLabels, Replace)
The Source parameter specifies the new data as a Range object.
The optional Rowcol parameter specifies whether the data series are in rows or columns in the
specified range. It can be one of the following XlRowCol constants:
Enum XlRowCol
xlRows = 1
xlColumns = 2 ' The default
End Enum
The optional SeriesLabels parameter applies only when Source is a range (not an array). It is
True if the first row or column contains the name of the data series and False if the first row or
column contains the first data point of the series. If this argument is omitted, Excel attempts to
determine the location of the series name from the contents of the first row or column. (As I have
stated several times before, my advice is to supply any values that you require, rather than letting
Excel guess.)
Similarly, the optional CategoryLabels parameter applies only when Source is a range (not
an array). It is True if the first row or column contains the name of the category labels and
False if the first row or column contains the first data point of the series. If this argument is
omitted, Excel attempts to determine the location of the category label from the contents of the
first row or column.
The optional Replace parameter has the following meaning: if CategoryLabels is True and
Replace is True , the specified categories replace the categories that currently exist for the series.
If Replace is False , the existing categories will not be replaced. The default value is False .
Search JabSto ::




Custom Search