Need the code below to automatically include current month and previous month without having to change the code each month. Thanks!
Sub ImportServiceJobs()
With Application
.ScreenUpdating = False
.DisplayAlerts = False
.EnableEvents = False
Workbooks.Open Filename:="F:\Purchasing\SERVICE.xls"
Dim LastRow As Long
With Sheets("Master")
LastRow = .Cells(Rows.Count, 2).End(xlUp).Row
.Range("$A$4298:$F$14000").AutoFilter Field:=2, Criteria1:=">" & CStr(Date - Day(Date)), Operator:=xlAnd
.Range("B2:F" & LastRow).SpecialCells(xlCellTypeVisible).Copy _
Workbooks("Test MATERIAL - TOOL REQUISITION FORM.xlsm").Worksheets("5 Digit Job List").Range("A2")
.AutoFilterMode = False
End With
ActiveWorkbook.Close
.ScreenUpdating = True
.DisplayAlerts = True
.EnableEvents = True
End With
End Sub
Bookmarks