
:max_bytes(150000):strip_icc()/organize-and-find-data-pivot-tables-R4-5c1a5cabc9e77c00015a2841.jpg)

If you want to know how to programmatically create a pivot table with a compatible pivot table version, here is the code: My troubleshooting advice for issues related to getting selected values would be to check the pivot table version for xlPivotTableVersion12 or greater. I recreated the pivot table in 2007 so that it was xlPivotTableVersion12. This pivot table version is not compatible with the functionality specified above. Even though I converted the workbook to 2007, the pivot table I was using was originally created in 2003 and as such, was xlPivotTableVersion10. Let me know if you need more info.ĭim pvtItem As PivotItemDim nwsheet As WorksheetDim rw As IntegerSet nwsheet = 0For Each pvtItem In Worksheets("qry ACT HoursParts").PivotTables("PivotTable1").PivotFields("Product Date").VisibleItems rw = rw + 1 nwsheet.Cells(rw, 1).Value = pvtItem.NameNextĪlthough I was using Excel 2007, the workbook was originally created in Excel 2003. When I executed the procedure it only looped through once and the only output was the value "(All)".

I only selected two selections and the Multiple Selections Property is turned on (obviously). I adapted the following code from the MSDN library. I am filtering on a field called "Product Date", which has up to 8 date filters. I have a pivot table who's data source is from an odbc connection to a query in Access. I have the same exact question as this previously answered thread, except for Excel not Access
