Computer Aided Automation
Excel AUTOFILL WITH VBA - Printable Version

+- Computer Aided Automation (
+-- Forum: CAA Discussions (
+--- Forum: VBA Programming (
+---- Forum: Excel VBA (
+---- Thread: Excel AUTOFILL WITH VBA (/thread-64.html)

Excel AUTOFILL WITH VBA - techberth - 23-02-2020


1. open a new file and insert button
2. save as macro enabled excel file
3. assign macro to the button and paste below code

Sub Button1_Click()

Dim range1 As Range

Dim range2 As Range
Set range1 = Sheet1.Range("A1:A2")

Set range2 = Sheet1.Range("A1:A10")

range1.AutoFill Destination:=range2

End Sub