Here is code I have to filter column M for 046s that is mostly working.
However, the Else part of my If statement isn't working, where if there are 046s I want to do a further filter and filter those 046s by column 8 for the values listed in the code.
How do I fix this?
However, the Else part of my If statement isn't working, where if there are 046s I want to do a further filter and filter those 046s by column 8 for the values listed in the code.
How do I fix this?
VBA Code:
Sub Filter046()
'
' Filter046 Macro
'
' Keyboard Shortcut: Ctrl+d
'
With ActiveSheet
.Range("A1:N1").AutoFilter Field:=13, Criteria1:="046"
If .AutoFilter.Range.Columns(1).SpecialCells(xlVisible).Count = 1 Then
Application.Run "'PERSONAL(1).xlsb'!FirmSignoff"
'ActiveWorkbook.Close SaveChanges:=True
Else
ActiveSheet.Range("$A$1:$N$151").AutoFilter Field:=8, Criteria1:= _
"=367,360,398", Operator:=xlOr, Criteria2:="=700,701,702,703,707"
End If
End With
End Sub