Good Morning,
I am trying to create a macro that pulls data in from another workbook.
Currently I can get the macro to open the file and copy the data, but i am being thick and missing something when trying to copy it to my open workbook.
The line in red below is where it isnt working. I am missing something that specifies the open workbook
Sorry, I am being a bit thick this morning.
Thanks
Gavin
I am trying to create a macro that pulls data in from another workbook.
Currently I can get the macro to open the file and copy the data, but i am being thick and missing something when trying to copy it to my open workbook.
The line in red below is where it isnt working. I am missing something that specifies the open workbook
Sorry, I am being a bit thick this morning.
Thanks
Gavin
Rich (BB code):
Application.ScreenUpdating = False
Dim src_wbk As Workbook
Dim Dest_Wbk As Workbook
Set Dest_Wbk = ActiveWorkbook
Sheets("Team Update").Select
Range("A2:AW8060").ClearContents
MyManager = Worksheets("Info").Range("J4").Value
If MyManager = "MGR1" Then
Set mybook = Workbooks.Open("MGR1.xlsx", Password:="mgr1l") 'Work
End If
If MyManager = "MGR2" Then
Set mybook = Workbooks.Open("MGR2.xlsx", Password:="mgr2") 'Work
End If
If MyManager = "MGR3" Then
Set mybook = Workbooks.Open("mgr3.xlsx", Password:="mgr3") 'Work
End If
Set src_wbk = mybook 'manager file open
ActiveWorkbook.Sheets("Quality").Select
ActiveSheet.Range("$A$3:$AW$50000").Copy
'copy to Quality
Set Dest_Wbk = Workbooks("Quality 2013 v2.xlsm")
Sheets("Team Update").Select
Range("A2").Select
ActiveSheet.Paste
'src_wbk.Close
src_wbk.Saved = False
src_wbk.Close