Hi Guys,
can someone tell me why this command doesn't work, the code gets all the way to .Clearallfilters and clears them all. But it wont recognise .currentpage = a
the value is a date in the format 19/09/2024 (not sure if that's got something to do with it?)
Sub pivotall()
Dim a As String
Dim pt As PivotTable
ThisWorkbook.Worksheets("data calculations").Activate
a = Worksheets("data calculations").Cells(1, 2).Value
Sheets("Data Calculations").Select
For Each pt In ActiveSheet.PivotTables
With pt.PivotFields("date")
.ClearAllFilters
.CurrentPage = a
End With
Next
End Sub
thanks as always.
can someone tell me why this command doesn't work, the code gets all the way to .Clearallfilters and clears them all. But it wont recognise .currentpage = a
the value is a date in the format 19/09/2024 (not sure if that's got something to do with it?)
Sub pivotall()
Dim a As String
Dim pt As PivotTable
ThisWorkbook.Worksheets("data calculations").Activate
a = Worksheets("data calculations").Cells(1, 2).Value
Sheets("Data Calculations").Select
For Each pt In ActiveSheet.PivotTables
With pt.PivotFields("date")
.ClearAllFilters
.CurrentPage = a
End With
Next
End Sub
thanks as always.