Name
range
.AutoFill(Destination
, [Type
])
Synopsis
Automatically fills in the cells in a specified destination range based on the specified source range.
Argument |
Settings |
---|---|
|
The cells to be filled, including the source range. |
|
The default value is |
If the value of cell A1 is 1, the following code automatically fills in the remaining cells in the range A1:A5 with the values 2 through 5:
Dim srcRange As Range Dim destRange As Range Set srcRange = ActiveSheet.Range("A1") Set destRange = ActiveSheet.Range("A1:A5") srcRange.AutoFill destRange, xlFillSeries
Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.