1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22:
Sub copy() Application.ScreenUpdating = False Dim wb1 As Workbook, wb2 As Workbook Set wb2 = ActiveWorkbook Dim loc As String, wb1Name As String Dim wb1WasOpen As Boolean wb1WasOpen = False loc = ActiveWorkbook.Path & "\" wb1Name = "Tracker_3244" On Error Resume Next Set wb1 = Workbooks(wb1Name) On Error GoTo 0 If wb1 Is Nothing Then Set wb1 = Workbooks.Open(loc & wb1Name & ".xls") Else wb1WasOpen = True End If wb1.Sheets("Summary").Range("B1:S66").Copy wb2.Sheets("Expenses").Range("B1:S66").PasteSpecial xlPasteValues If Not wb1WasOpen Then wb1.Close Application.ScreenUpdating = True End Sub