Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have you found a way to get a full list of all DataFields ?
"JsJ_Slim" wrote: Hi everyone, After going through (and testing) almost every class in the Excel 2007 reference doc that contains the word "Pivot", I think I've finally figured out how to get the labels: // Selected cell (in this case, the active cell) PivotCell cell = Application.ActiveCell.PivotCell; PivotItemList pivotRow = cell.RowItems; PivotItemList pivotColumn = cell.ColumnItems; // Retrieve row labels for (int i = 1; i <= pivotRow.Count; i++) rowLabels.Add(pivotRow.Item(i).Caption); // Retrieve column labels for (int i = 1; i <= pivotColumn.Count; i++) columnLabels.Add(pivotColumn.Item(i).Caption); Man, it was really hard to figure this one out, especially when I didn't know all the terms and keywords. In any case, hope this will help anyone who needs it in the future. If this is the wrong approach, please let me know too. Thanks! Josh |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to create pivot table from existing pivot table in excel 2007 | Excel Discussion (Misc queries) | |||
Copying values from pivot table to cells outside pivot table | Excel Discussion (Misc queries) | |||
Filter lines containing pivot table and non pivot table data | Excel Worksheet Functions | |||
How do I create a pivot table if the pivot table icon or menu ite. | Charts and Charting in Excel | |||
Help required with setting up a pivot table with the source on sheet1 to have the pivot table created on sheet called "report" | Excel Programming |