I am trying to declare a workbook location as a variable so I do not have to change the name in 100 locations. The block of code is copied multiple times only the destination changes
Sub copyToDatabase_2() ' ' Copy from seperator to DB ' Dim location_1 As Workbooks Dim location_2 As Workbooks location_1 = "Table Separator (M2).xlsm" location_2 = "TCE-525 (M2) DAVID.xlsm" Windows(location_1).Activate Range("A5:E16").Select Selection.Copy Windows(location_2).Activate Range("R3").Select ActiveSheet.Paste Windows(location_1).Activate Range("A19:E30").Select Selection.Copy Windows(location_2).Activate Range("R35").Select ActiveSheet.Paste End Sub error received is
Compile error: Invalid use of property.
SelectandActivateand also how to reference each workbook.