Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
PivotTable VBA help needed
Hi I am really stuck with this one and spent hours trying to work it out but
without success I am trying to get a pivot table field to return/Copy a name from a cell on a sheet, For example in the ROW section of the Pivot Table there could be up to a hundred questions to select from (which could change from week to week) and as you can imagine would be a nightmare to keep changing, especially as there is going to be 50 sheets/tabs to change in the workbook. I copied and tried to adapt this code that I found earlier without success: Sub Macro2() Dim ID As String Dim PT As PivotTable Dim PF As PivotField Dim PI As PivotItem ID = ActiveSheet.Range("question_title") On Error Resume Next For Each PT In ActiveSheet.PivotTables Set PF = PT.PivotFields.question_title Set PI = Nothing Set PI = PF.PivotFields(ID) Next On Error GoTo 0 End Sub I named the cell with a Range Name of question_title, but I presume I will need to have a different name for each tab or can I just specify a cell? Help as usual greatly appreciated John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Deleting Rows With Non-Needed Data between Needed Data | Excel Worksheet Functions | |||
Creating a PivotTable w/o selecting data in an existing PivotTable | Excel Discussion (Misc queries) | |||
How does one get the PivotTable report info that feeds another PivotTable report? | Excel Programming | |||
PivotTable - PivotTable Field name is not valid - error! | Excel Programming | |||
Creating a PivotTable Report from an Another PivotTable Report | Excel Programming |