My data will be updated everyday and when the pivot table is refreshed I want to set the Filter "AreaDescription" to a specific value and I want to set the row "Week" to a range of values. These values will all be based on values in the cells on a different sheet in the workbook. Below is the code I created, but it is getting an error on both the filter commands.
Dim PvtTbl As PivotTable
Dim WeekStart As Integer
Dim WeekEnd As Integer
Dim Area As String
Set PvtTbl = Worksheets("PivotTable").PivotTables("PivotByArea")
WeekStart = Worksheets("Misc").Range("D2")
WeekEnd = Worksheets("Misc").Range("D3")
Area = Worksheets("Misc").Range("G1")
PvtTbl.PivotFields("AreaDescription").PivotFilters.Add Type:=xlCaptionEquals, _
PvtTbl.PivotFields("Week").PivotFilters.Add Type:=xlValueIsBetween, _
Thank you in Advanced!