goldbeck09
New Member
- Joined
- Aug 21, 2014
- Messages
- 22
Hello,
I have multiple workbooks that I need to combine into one main master workbook. I have a macro already in place that opens/closes all the workbooks, I just need help looping through each open workbook and placing the data into my master sheet. See my progress below so far:
My main spreadsheet is a blank except row 1 is a header.
I have multiple workbooks that I need to combine into one main master workbook. I have a macro already in place that opens/closes all the workbooks, I just need help looping through each open workbook and placing the data into my master sheet. See my progress below so far:
My main spreadsheet is a blank except row 1 is a header.
Code:
Sub copydata()
Dim Book As Workbook
For Each Book In Workbooks
Range("A12").Select
'ActiveCell.Offset(RowOffset:=2, columnoffset:=0).Activate
'Range(Selection, Selection.End(xlToLeft)).Select
Rows(ActiveCell.Row).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Workbooks("Intl Macro.xlsx").Activate
Sheets("Sheet1").Activate
erow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
ActiveSheet.Paste Destination:=Worksheets("Sheet1").Rows(erow)
Next Book
End Sub