Applies To
Range Object.
Description
Creates a data series in the range.
Syntax
object.DataSeries(rowcol, type, date, step, stop, trend)
object
Required. The range where the data series will be created.
rowcol
Optional. Can be xlRows or xlColumns to enter the data series in rows or columns, respectively. If omitted, the size and shape of the range is used.
type
Optional. Can be xlLinear, xlGrowth, xlChronological, or xlAutoFill. If omitted, it is xlLinear.
date
Optional. If the type argument is xlChronological, this indicates the date unit by which to step, either xlDay, xlWeekday, xlMonth, or xlYear. If omitted, it is xlDay.
step
Optional. The step value for the series. If omitted, it is assumed to be 1.
stop
Optional. The stop value for the series. If omitted, the method fills to the end of the range.
trend
Optional. If True, the method creates a linear or growth type of trend. If False or omitted, the method creates a standard data series.
Example
This example creates a series of 12 dates. The series contains the last day of every month in 1996 and is created in the range A1:A12 on Sheet1.
Set dateRange = Worksheets("Sheet1").Range("A1:A12") Worksheets("Sheet1").Range("A1").Formula = "31-JAN-1996" dateRange.DataSeries Type:=xlChronological, Date:=xlMonth