here's the macro:
Windows("WB1.xlsm").Activate
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Range(Selection, Selection.End(xlUp)).Select
Selection.Copy
Workbooks.Open Filename:= _
"WB2.xlsm"
'
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.Paste
ActiveSheet.Name = "NEWDATA"
Range("A1").Activate
ActiveWorkbook.Save
Range("A1").Activate
ActiveWindow.Close
Windows("WB1.xlsm").Activate
Sheets("Temp").Select
ActiveWindow.SelectedSheets.Delete
When I run it, it stops on the WB2 open and makes goes into Developer - Design Mode. If I put a breakpoint in it it will run correctly. """
Windows("WB1.xlsm").Activate
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Range(Selection, Selection.End(xlUp)).Select
Selection.Copy
Workbooks.Open Filename:= _
"WB2.xlsm"
'
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.Paste
ActiveSheet.Name = "NEWDATA"
Range("A1").Activate
ActiveWorkbook.Save
Range("A1").Activate
ActiveWindow.Close
Windows("WB1.xlsm").Activate
Sheets("Temp").Select
ActiveWindow.SelectedSheets.Delete
When I run it, it stops on the WB2 open and makes goes into Developer - Design Mode. If I put a breakpoint in it it will run correctly. """