I have an issue pulling in multiple sheets from one workbook into another workbook in Excel. I have been around the posts, and can't seem to find a good solution. I have two-subs that work together. The first is set to a button that the end user will get the source file with the raw data (this file name will be different every time). This part seems to work just fine:
Once this source file is open, there will be between 10-20 sheets with data that I need to pull into the other workbook "18AWM036_IMG_BondEdge_ReportBook_WM111_manual.xlsm"
Those sheets in the source file will always have changing names and the number of sheets will vary, so this will need to work given those criteria. Each sheet in the source file will also vary, so I made the 'Copy' range vast. Once copied I need those source file sheets copied into the other workbook at the very end. Here is the code, which doesn't work quite right. Trying to see where my issue is (I have a background in Java, but not VBA):
[CODE]
Sub readExcelData(sTheSourceFile)
Application.ScreenUpdating = False
Dim src As Workbook, x As Long
Set src = Workbooks.Open(sTheSourceFile, False, True)
For x = 1 To Sheets.Count
src.Sheets(x).Select
Sheets(x).Range("A1", "ZZ500").Copy
Workbooks.Open ("18AWM036_IMG_BondEdge_ReportBook_WM111_manual.xlsm")
Sheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.Paste
src.Activate
Next x
End Sub
Bookmarks