Hi,
I have a macro and I'm trying to make it select only values greater than or equal to the value in a cell.
It's doing something, but it just seems to be filtering out random numbers...
Any ideas?
Cheers
Chris
I have a macro and I'm trying to make it select only values greater than or equal to the value in a cell.
Code:
Dim pt1 As PivotTable
Dim Field4 As PivotField
Dim NewCat4 As String
Dim pi2 As PivotItem
NewCat4 = Range("d3").Value
Set pt1 = PivotTables("PivotTable1")
Set Field4 = pt1.PivotFields("Ignore")
pt1.AllowMultipleFilters = True
For Each pi2 In Field4.PivotItems
If Not ((pi2.Value >= NewCat4)) Then
pi2.Visible = False
End If
Next
It's doing something, but it just seems to be filtering out random numbers...
Any ideas?
Cheers
Chris