The Marco below will print out sheets even if there is not a match to the criteria, is there anyway to change that, in column G, I have the formula =IF(ISNA(VLOOKUP(B10,building_list,2,FALSE)),"",VLOOKUP(B10,building_list,2,FALSE)), down to row 500, is it because of this it is printing a lot of sheets? Thanks, using Excel ‘97
Code:
Private Sub Print_Macro()
Application.ScreenUpdating = False
Sheets("workorders").Select
Selection.AutoFilter Field:=5, Criteria1:="72"
Selection.AutoFilter Field:=6, Criteria1:="="
ActiveSheet.PageSetup.PrintArea = "$A:$G"
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Selection.AutoFilter Field:=5, Criteria1:="73"
Selection.AutoFilter Field:=6, Criteria1:="="
ActiveSheet.PageSetup.PrintArea = "$A:$G"
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Selection.AutoFilter Field:=5, Criteria1:="74"
Selection.AutoFilter Field:=6, Criteria1:="="
ActiveSheet.PageSetup.PrintArea = "$A:$G"
ActiveWindow.SelectedSheets.PrintOut Copies:=1
ActiveSheet.PageSetup.PrintArea = ""
Selection.AutoFilter Field:=5
Selection.AutoFilter Field:=6
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Application.ScreenUpdating = True
End Sub