I am currently filtering for "Salary" in the below pivot table and then deleting the rows that are have the entry. I need to add one additional filter called DeclaredTips and filter it for <> 0 after I filter for Salary. DeclaredTips is in Column X. SO, I want to remove all Salary where DeclaredTips <> 0.
VBA Code:
'Pay Type
Rows("1:1").Select
Selection.AutoFilter
With ActiveWindow
.SplitColumn = 0
.SplitRow = 1
End With
ActiveWindow.FreezePanes = True
Range("A1").Select
Dim LastRowOne As Long
LastRowOne = Cells(Rows.Count, "A").End(xlUp).Row
Range("N2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-13],Data!C[-13]:C[26],17,FALSE)"
Range("N2:N" & Range("B" & Rows.Count).End(xlUp).Row).FillDown
ActiveSheet.Range("$A$1:$BH$" & LastRowOne).AutoFilter Field:=14, Criteria1:= _
"Salary"
With ActiveSheet.AutoFilter.Range
If .Columns(1).SpecialCells(xlVisible).Count > 1 Then
.Offset(1).Resize(.Rows.Count - 1).EntireRow.Delete
If .Parent.FilterMode Then .Parent.ShowAllData
End If
End With
Rows("1:1").Select
Selection.AutoFilter
Selection.AutoFilter
Dim LastRowTwo As Long
LastRowTwo = Cells(Rows.Count, "A").End(xlUp).Row
ActiveSheet.Range("$A$1:$BH$" & LastRowTwo).AutoFilter Field:=6, Criteria1:= _
"0"
With ActiveSheet.AutoFilter.Range
If .Columns(1).SpecialCells(xlVisible).Count > 1 Then
.Offset(1).Resize(.Rows.Count - 1).EntireRow.Delete
If .Parent.FilterMode Then .Parent.ShowAllData
End If
End With
Selection.AutoFilter
Selection.AutoFilter
Range("N2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-13],Data!C[-13]:C[26],15,FALSE)"
Range("N2:N" & Range("B" & Rows.Count).End(xlUp).Row).FillDown
Selection.AutoFilter
Selection.AutoFilter
Range("N1").Select
Selection.FormulaR1C1 = "JOBCODE"