Skip to content

Latest commit

 

History

History
50 lines (31 loc) · 1.21 KB

Excel.Range.AutoFill.md

File metadata and controls

50 lines (31 loc) · 1.21 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Range.AutoFill method (Excel)
vbaxl10.chm144083
vbaxl10.chm144083
Excel.Range.AutoFill
257f6608-9211-86f9-79de-e3c44df8f3fd
05/10/2019
medium

Range.AutoFill method (Excel)

Performs an autofill on the cells in the specified range.

Syntax

expression.AutoFill (Destination, Type)

expression A variable that represents a Range object.

Parameters

Name Required/Optional Data type Description
Destination Required Range The cells to be filled. The destination must include the source range.
Type Optional XlAutoFillType Specifies the fill type.

Return value

Variant

Example

This example performs an autofill on cells A1:A20 on Sheet1, based on the source range A1:A2 on Sheet1. Before running this example, type 1 in cell A1 and type 2 in cell A2.

Set sourceRange = Worksheets("Sheet1").Range("A1:A2") 
Set fillRange = Worksheets("Sheet1").Range("A1:A20") 
sourceRange.AutoFill Destination:=fillRange

[!includeSupport and feedback]