I need to copy and paste certain rows/columns from one workbook to another, and I have like hundreds of these. How can I cut it down so the macro runs faster and I don't have to repeat this code a hundred times?
Here's my sample:
' Copy and Paste [A]
Windows("" & var_Download_Filename).Activate
Sheets("" & var_Download_sheetname).Select
Range("A" & int_Download_Firstrow & ":A" & int_Download_Lastrow).Select
Selection.Copy
Windows("" & var_Template_filename).Activate
Sheets("" & var_Template_sheetname).Select
Range("A" & int_Template_Firstrow & ":A" & int_Template_Lastrow).Select
Selection.PasteSpecial
' Copy and Paste [B]
Windows("" & var_Download_Filename).Activate
Sheets("" & var_Download_sheetname).Select
Range("B" & int_Download_Firstrow & ":B" & int_Download_Lastrow).Select
Selection.Copy
Windows("" & var_Template_filename).Activate
Sheets("" & var_Template_sheetname).Select
Range("B" & int_Template_Firstrow & ":B" & int_Template_Lastrow).Select
Selection.PasteSpecial
' Copy and Paste Region [I]
Windows("" & var_Download_Filename).Activate
Sheets("" & var_Download_sheetname).Select
Range("I" & int_Download_Firstrow & ":I" & int_Download_Lastrow).Select
Selection.Copy
Windows("" & var_Template_filename).Activate
Sheets("" & var_Template_sheetname).Select
Range("C" & int_Template_Firstrow & ":C" & int_Template_Lastrow).Select
Selection.PasteSpecial
Many thanks!!
Bookmarks