I have code below to filter the data byt displaying all values in Col I (rows 4 is the header) except zeroes
When running the macro, only one zero is being displayed which is the last filtered item. Col A to G is a Pivot table
Kindly amend my code so no zeroes are displayed
End Sub
When running the macro, only one zero is being displayed which is the last filtered item. Col A to G is a Pivot table
Kindly amend my code so no zeroes are displayed
Code:
Sub FilterValuesNotZero()
Dim ws As Worksheet
Dim rng As Range
' Set the worksheet and range variables
Set ws = ThisWorkbook.Sheets("Sales per type")
Set rng = ws.Range("I5:I" & ws.Cells(ws.Rows.Count, "I").End(xlUp).Row)
' Clear any existing filters
ws.AutoFilterMode = False
' Apply the filter to show values in column I that are not equal to zero
rng.Autofilter Field:=1, criteria1:="<>0.00"
End Sub
End Sub