Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting Rows With Non-Needed Data between Needed Data Daren Excel Worksheet Functions 2 September 30th 08 06:47 PM
Creating a PivotTable w/o selecting data in an existing PivotTable Damian Excel Discussion (Misc queries) 6 November 2nd 07 04:44 PM
How does one get the PivotTable report info that feeds another PivotTable report? Toby Erkson[_3_] Excel Programming 0 December 14th 04 10:00 PM
PivotTable - PivotTable Field name is not valid - error! miker1999[_17_] Excel Programming 1 June 10th 04 10:30 AM
Creating a PivotTable Report from an Another PivotTable Report bcpaulus Excel Programming 1 January 8th 04 07:56 PM


All times are GMT +1. The time now is 04:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"