Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88868

VBA loop to copy & paste range of specific columns to another workbook multiple times

$
0
0

I am trying to figure out the quickest Loop method to copy a range of columns ("A16:J1338") from a source workbook, to a specific column (C1) of a specific workbook, 10 times. I would like to that macro to paste the data below the last available blank cell (under COL C)

Here's my code;

Sub copy_Loop()
Dim LastRow As Long
Range("A16:J1338").Select
Selection.Copy
Workbooks.Open "C:\Users\Manzurfa\Desktop\1. Forecast Amalgamation.xlsx"
Range("C1").Select
ActiveSheet.Paste
Windows("Merrell CA Forecast Template - Alain Travers.xlsm").Activate
Range("K18:O1338").Select
Selection.Copy
Windows("1. Forecast Amalgamation.xlsx").Activate
Range("K3").Select
 Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
Windows("Merrell CA Forecast Template - Alain Travers.xlsm").Activate
Range("A16:J1338").Select
Selection.Copy
 Windows("1. Forecast Amalgamation.xlsx").Activate     
Range("B1").Select
Selection.End(xlDown).Select
ActivCell.Offset(0, 1).Select
Selection.End(xlUp).Select
ActivCell.Offset(1, 0).Select
ActiveSheet.Paste

ActiveWorkbook.Save
End Sub

The columns ("A16:J1338") have blank rows in between and I would like the macro to overlook the blanks and loop the copy-paste under the last available blank cell.

I would be very grateful for any help on this.


Viewing all articles
Browse latest Browse all 88868

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>