Hi. I am creating a slide based off the data in a pivot table. The Pivot table has 2 filters, "Market" & "HH Characteristic". I need to create a slide for each HH Characteristic within each Market. For example, there are 3 markets and 5 characteristics. For each market, I must create a slide with the data from each of the characteristics. So in this example I would need to create 15 slides. Instead of doing this manually, I am trying to create a macro that will automatically select the Market then a characteristic and create a slide, then the next characteristic and create a slide until there are no more characteristics left. AT that point, I want it to select the next market and repeat for each of the characteristics unitl there are no more Markets left. I already have an idea of how to get the slide created, so you needn't worry about that aspect of it. What I am hoping you can help me with is figuring out how to get VBA to select the Market filter items and the Characteristic filter items and out the corresponding data on the pivot table so my slide macro creation macro can take it from there.
Here's an example of the script I have so far. It seems to be moving through the filter items, but not updating the pivot table with the data. Thanks in advance for any help you can provide.
Sub Cycle_Filters()
Application.ScreenUpdating = False
Dim pt As PivotTable
Dim pim As PivotItem
Dim pic As PivotItem
Dim pfm As PivotField
Dim pfc As PivotField
For Each pt In ActiveSheet.
Set pfm = pt.PivotFields("Market")
Set pfc = pt.PivotFields("HH Characteristic")
For Each pim In pfm.PivotItems
pim.Visible = True
For Each pic In pfc.PivotItems
Next pic
Next pim
Next pt
Application.ScreenUpdating = True
End Sub
Here's an example of the script I have so far. It seems to be moving through the filter items, but not updating the pivot table with the data. Thanks in advance for any help you can provide.
Sub Cycle_Filters()
Application.ScreenUpdating = False
Dim pt As PivotTable
Dim pim As PivotItem
Dim pic As PivotItem
Dim pfm As PivotField
Dim pfc As PivotField
For Each pt In ActiveSheet.
Set pfm = pt.PivotFields("Market")
Set pfc = pt.PivotFields("HH Characteristic")
For Each pim In pfm.PivotItems
pim.Visible = True
For Each pic In pfc.PivotItems
Next pic
Next pim
Next pt
Application.ScreenUpdating = True
End Sub