I have a workbook (WB1) that contains multiple worksheets. I need my current workbook (WB2) to go into workbook (WB1) and copy the multiple worksheets and combine them into one worksheet in WB2.
I was able to work out... within the same workbook to combine all the worksheets into one but have had trouble copying and combining the data into an separate workbook.
Sub CombineData()
Dim Sht As Worksheet
For Each Sht In ActiveWorkbook.Worksheets
If Sht.Name <> "Master" And Sht.Range("A1").Value <> "" Then
Sht.Select
LastRow = Range("A65536").End(xlUp).Row
Range("A1", Cells(LastRow, "T")).Copy
Sheets("Master").Select
Range("A65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Else
End If
Next Sht
End Sub
Please help.
I was able to work out... within the same workbook to combine all the worksheets into one but have had trouble copying and combining the data into an separate workbook.
Sub CombineData()
Dim Sht As Worksheet
For Each Sht In ActiveWorkbook.Worksheets
If Sht.Name <> "Master" And Sht.Range("A1").Value <> "" Then
Sht.Select
LastRow = Range("A65536").End(xlUp).Row
Range("A1", Cells(LastRow, "T")).Copy
Sheets("Master").Select
Range("A65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Else
End If
Next Sht
End Sub
Please help.