Hi Everyone,
I have a workbook that contains a lot of OLAP pivot tables and so the goal for me is to create a macro that will automatically change the filter known as "month year" for all of the pivot tables in this workbook. The good news is that the macro I wrote manages to do that, but now I am trying to figure out a way to add an inputbox for other users who can type the month & year rather than going inside the VBA Code and adjusting the code.
Any help or clue is appreciated!
I have a workbook that contains a lot of OLAP pivot tables and so the goal for me is to create a macro that will automatically change the filter known as "month year" for all of the pivot tables in this workbook. The good news is that the macro I wrote manages to do that, but now I am trying to figure out a way to add an inputbox for other users who can type the month & year rather than going inside the VBA Code and adjusting the code.
Any help or clue is appreciated!
VBA Code:
Sub Testing_Filter_Changes()
Dim ws As Worksheet
Dim changemonth As String
changemonth = InputBox(Prompt:="Month and Year?")
For Each ws In ThisWorkbook.Worksheets
ws.PivotTables("PivotTableGPR").PivotFields( "[Calendar].[Month Year].[Month Year]").CurrentPageName = _
"[Calendar].[Month Year].&[changemonth]"
Next ws
End Sub