In my VBA code for my PivotTable, I have the below items hard coded. Is there a way to make the dates that I want to set to False relative? So, I want the date in Sheet1 J1 to be in place of "1/16/23" in the first row below. Is this possible?
VBA Code:
With ActiveSheet.PivotTables("PivotTable075342").PivotFields("DOB")
.PivotItems("1/16/23").Visible = False
.PivotItems("1/17/23").Visible = False
.PivotItems("1/18/23").Visible = False
.PivotItems("1/19/23").Visible = False
End With