When changing the cell values it changes the page filter for the OLAP
pivottable.
I can select the date i want, but it will not clear the previous selection.
So far any code i have tried has either not worked or resulted in an error,
or selected all the dates and jumped out of the code without returning an
error. Any Idea's ?
Dim YTEMP As String 'Year
Dim MTEMP As String 'Month
Dim DTEMP As String ' Day
Dim str As String
Dim str2 As String
Dim str3 As String
str = Sheets("Days").Range("H1").Value
str2 = Sheets("Days").Range("H2").Value 'Get values fron cell range
str3 = Sheets("Days").Range("H3").Value
YTEMP = str
MTEMP = str2 'Store Variables to holders
DTEMP = str3
'Apply filter
ActiveSheet.PivotTables("DAYSA").PivotFields("[Date]").AddPageItem _
"[Date].[All].[" & YTEMP & "].[" & MTEMP & "].[" & DTEMP & "]"
Thanks EI
Bookmarks