I'm probably missing something simple here. It just isn't copying the data from the source workbook to the target workbook and no errors are tripping. The source workbook is opening just fine. The target workbook contains this code. Both workbooks contain a sheet called 'Data'. Any help would be greatly appreciated.
Sub TransferData()
Dim wbTarget As Workbook
Dim wbSource As Workbook
Set wbSource = Workbooks.Open("C:\folder\source.xls")
Set wbTarget = Workbooks.Open("C:\folder\target.xlsm")
wbSource.Activate
Sheets("Data").Select
ActiveSheet.Range("B7").Copy
wbTarget.Activate
Sheets("Data").Select
ActiveSheet.Range("A1").Paste
End Sub
Sheets("Data").Selectis ambiguous because you have two workbooks with the sheet data open. AddwbSourceandwbTargetas shown in my answer.