Hi Jerry,
Thanks for your prompt reply. I have tried something like below: but i'm getting error - run time error '1004: "application-defined or object-defined error"
FilterValue = ActiveSheet.Range("ah50").Value 'get value for filter
ActiveSheet.PivotTables("PivotTable2") _
.PivotFields("[Tbl_POS_OD_RBD_Bkgs].[BKG_DT].[BKG_DT]").ClearAllFilters
ActiveSheet.PivotTables("PivotTable2").PivotFields("[Tbl_POS_OD_RBD_Bkgs].[BKG_DT].[BKG_DT]") _
.CurrentPageName = "[Tbl_POS_OD_RBD_Bkgs].[BKG_DT].&[" & FilterValue & "]"
Cell AH50-56 has dates from 11/02/2016 (dd-mm-yy) format.
when i recorded a macro to select ppfilter it gave me below codes:
ActiveSheet.PivotTables("PivotTable2").PivotFields( _
"[Tbl_POS_OD_RBD_Bkgs].[BKG_DT].[BKG_DT]").VisibleItemsList = Array( _
"[Tbl_POS_OD_RBD_Bkgs].[BKG_DT].&[2016-02-11T00:00:00]", _
"[Tbl_POS_OD_RBD_Bkgs].[BKG_DT].&[2016-02-12T00:00:00]", _
"[Tbl_POS_OD_RBD_Bkgs].[BKG_DT].&[2016-02-13T00:00:00]", _
"[Tbl_POS_OD_RBD_Bkgs].[BKG_DT].&[2016-02-14T00:00:00]", _
"[Tbl_POS_OD_RBD_Bkgs].[BKG_DT].&[2016-02-15T00:00:00]", _
"[Tbl_POS_OD_RBD_Bkgs].[BKG_DT].&[2016-02-16T00:00:00]", _
"[Tbl_POS_OD_RBD_Bkgs].[BKG_DT].&[2016-02-17T00:00:00]")
I was added ppfilters coz i'm unable to control the slicers using vba to select a date range from 11/02/2016 - 17/02/2016.
I wanted date selection to be triggered by the cell values of AH50 and AH56.
I also wanted to control the slicer for the travel month: "[Tbl_POS_OD_RBD_Bkgs].[TRVL_MNTH].[TRVL_MNTH]" by a cell value in AH49.
Hope you can help me again.