Computer Aided Automation
Excel AUTOFILL WITH VBA - Printable Version

+- Computer Aided Automation (https://computeraidedautomation.com)
+-- Forum: CAA Discussions (https://computeraidedautomation.com/forum-7.html)
+--- Forum: VBA Programming (https://computeraidedautomation.com/forum-1.html)
+---- Forum: Excel VBA (https://computeraidedautomation.com/forum-2.html)
+---- Thread: Excel AUTOFILL WITH VBA (/thread-64.html)



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

AUTOFILL WITH VBA


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