+ Reply to Thread
Results 1 to 10 of 10

SourceData pointing to another PivotTable

  1. #1
    Registered User
    Join Date
    11-08-2004
    Posts
    8

    SourceData pointing to another PivotTable

    I have multiple pivot tables in one worksheet, however when I set the SourceData for each one of them to a range the size of the file grows drastically. What I tried is setting the SourceData on one of them to the range and then in a loop set the SourceData for each one of the other PivotTables to point to the first one, but I keep getting an error. Any ideas what I am doing wrong?

    Please Login or Register  to view this content.
    However this is giving me an error on the follolwing line

    pt.PivotTableWizard SourceType:=xlPivotTable, SourceData:="MainPivot"

    Run-time error '1004':
    Application-defined or object-defined error
    Last edited by ivanov_nv; 07-02-2010 at 08:03 AM.

  2. #2
    Registered User
    Join Date
    11-08-2004
    Posts
    8

    Re: SourceData pointing to another PivotTable

    I am sorry about this. I have modified it and placed the [code] tags around it.

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: SourceData pointing to another PivotTable

    Change each pivottable's cacheindex to be the cacheindex of the main pivot table.
    Remember what the dormouse said
    Feed your head

  4. #4
    Registered User
    Join Date
    11-08-2004
    Posts
    8

    Re: SourceData pointing to another PivotTable

    I have tried quite a few things, but nothing I tried, worked. Would you mind providing me with a code suggestion. Thank you for your assistance.

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: SourceData pointing to another PivotTable

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-08-2004
    Posts
    8

    Re: SourceData pointing to another PivotTable

    romperstomper, you are a genius. Thank you from the bottom of my heart.

  7. #7
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: SourceData pointing to another PivotTable

    I know.
    You're welcome.

  8. #8
    Registered User
    Join Date
    11-08-2004
    Posts
    8

    Re: SourceData pointing to another PivotTable

    romperstomper, while I have you and since you have been so helpful, can you point me in the right direction for the following:

    I have a List in one of my WorkSheets called DivisionList. It lists various names of Divisions in a Company. I am displaying this list on a page called Home and allowing the user to select a Division for which the report and graphs will be created. Based on the selection from Home, in the Data worksheet (this is where my data is), I have created a column that refers to client's selection from the list and if a name of a division is selected, it calculates the value of the cell in the column weather the data should be used: Yes or No. The formula used in tis column is:

    Please Login or Register  to view this content.
    Home!$D$7 is where the client has selected the individual name
    AE2 also has the names of the divisions in the data sheet. making sure that client's selection from the list matches this.
    Total Company is a custom item in the list that will prepare reports for all Divisions.

    Is there code, that would allow the client to select multiple Divisions and based on this multiple selection, the calculation in my cell to still work?

  9. #9
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: SourceData pointing to another PivotTable

    Can you post that as a new question please, since it bears no relation to this one?

  10. #10
    Registered User
    Join Date
    11-08-2004
    Posts
    8

    Re: SourceData pointing to another PivotTable

    absolutely! here is the new thread: http://www.excelforum.com/excel-prog...s-vb-code.html

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1