I'm currently using the code below to copy data from another workbook into the current one.
The only problem is that the worksheet in the second book can change name. As there is only ever one sheet in the second book is there anyway to select that sheet automatically and paste into the current workbook?
The current workbook will always have a sheet called "Data".
Workbooks.Open FileToOpen
Sheets("Data").Select
Cells(1, 1).CurrentRegion.Copy Destination:=SourceBook.Sheets("Data").Range("A1:AE65536").End(xlUp).Offset(0, 0)
The only problem is that the worksheet in the second book can change name. As there is only ever one sheet in the second book is there anyway to select that sheet automatically and paste into the current workbook?
The current workbook will always have a sheet called "Data".
Workbooks.Open FileToOpen
Sheets("Data").Select
Cells(1, 1).CurrentRegion.Copy Destination:=SourceBook.Sheets("Data").Range("A1:AE65536").End(xlUp).Offset(0, 0)