You could try this.
Sub Maybe()
Dim wb1 As Workbook, wb2 As Workbook
Application.ScreenUpdating = False
Set wb1 = ThisWorkbook
On Error Resume Next
Set wb2 = Workbooks("C:/users/me/Documents/Reports/MasterReport.xlsm")
'If it is not open, open it
If Err Then Set wb2 = Workbooks.Open("C:/users/me/Documents/Reports/MasterReport.xlsm")
On Error GoTo 0
With wb1.Sheets("Sheet1")
'From TMS
.Range("A" & .Cells(.Rows.Count, "A").End(xlUp).Row).Resize(1, 20).Copy wb2.Sheets("Sheet2").Range("A1")
'or if it needs to go in the first empty row
'.Range("A" & .Cells(.Rows.Count, "A").End(xlUp).Row).Resize(1, 20).Copy wb2.Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Offset(1)
End With
wb2.Close True '<---- If it needs saving. If not, use False instead of True
End Sub
Bookmarks