I have one WB open (ThisWorkbook) and the code bellows opens a 2nd one (cg.xlsm).
It copies cells A1:A1000 and pastes them into ThisWorkbook starting at L1500 on sheet Target Sheet.
This all works except for line above Sub , closing the captain_WB. How do I fix this?
Additionally, if I want to open the WB I use "Workbooks.Open captain_WB" but I tried to close the WB using "Workbooks.Close captain_WB" as it would seem to mirror the open WB line but that didn't work either. Help is appreciated.
Sub get_cg_report()
Dim WBDest As Workbook
Set WBDest = ThisWorkbook
Dim cg_WB
captain_WB = "c:\users\myname\my documents\cg.xlsm"
Workbooks.Open captain_WB
Sheets("sheet1").Range("A1:A1000").Copy 'copy a specific range
WBDest.Activate 'activate the target workbook
Worksheets("Target Sheet").Range("L1500").PasteSpecial 'paste the range to cell a1500
Workbooks(captain_WB).Close False
end sub
Bookmarks