Hi,
I am trying to iterate through multiple worksheets and copy and paste the data through multiple (equivalently named) worksheets in a separate workbook.
Essentially:
Workbook 1 - Sheet 1 - copy range
Workbook 2 - Sheet 1 - paste range in next empty row
Workbook 1 - Sheet 2 - copy range
Workbook 2 - Sheet 3 - paste range in next empty row
etc. for about 50 sheets.
I have VBA that will copy one range of cells on a single worksheet and paste to iterative sheets on a second workbook, but need to also iterate through the first sheet.
e.g. for a single worksheet in workbook 1
How do I apply a for loop for the 50 sheets in workbook 1 as well?
thanks
I am trying to iterate through multiple worksheets and copy and paste the data through multiple (equivalently named) worksheets in a separate workbook.
Essentially:
Workbook 1 - Sheet 1 - copy range
Workbook 2 - Sheet 1 - paste range in next empty row
Workbook 1 - Sheet 2 - copy range
Workbook 2 - Sheet 3 - paste range in next empty row
etc. for about 50 sheets.
I have VBA that will copy one range of cells on a single worksheet and paste to iterative sheets on a second workbook, but need to also iterate through the first sheet.
e.g. for a single worksheet in workbook 1
Code:
Sub singlecopy()
Dim sht As Worksheet
Sheets("Sheet1").Range("a2:c2").Copy
With Workbooks("summarysheet.xlsx")
For i = 1 To .Sheets.Count
.Sheets(i).Range("B" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues, Transpose:=True
Next i
End With
End Sub
How do I apply a for loop for the 50 sheets in workbook 1 as well?
thanks