+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    England
    Posts
    4

    Pivot Chart Only Updates when in Own Sheet

    Hello!

    I've got a macro that creates a line chart based on the data in a pivot table.

    Originally, I had

    Code:
    ActiveChart.Location Where:=xlLocationAsNewSheet
    in the VBA, causing the chart to appear in its own sheet. When I used one of the drop down menus on the pivot table to remove rows from the table, the chart updated accordingly, showing lines only for the fields shown in the table.

    However, once I removed the above line of code, as I need the chart to appear in the same worksheet as the table, the chart no longer updates when I change the pivot table. It always shows all the data, regardless of how I change the table.

    Does anyone know of a way to put the chart in the same worksheet as the pivot table but still have it update when I change the pivot table?

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944
    I used the following to move a pivot chart sheet to a pivot chartobject on a worksheet without a problem.

    I think we need more detail of what you did.

    Code:
    ActiveChart.Location Where:=xlLocationAsObject,Name:="Sheet1"
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    11-03-2008
    Location
    England
    Posts
    4
    Thanks Andy, but my problem is simply that, when I make a chart based on a pivot table in its own sheet, it updates along with the source table. When it's in the same sheet as the table, it doesn't. I'm not sure how to sort out this problem.
    Last edited by Ambulare; 11-20-2008 at 08:17 AM.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944
    Can you construct an example and attach it?

    Also which version of xl are you using?
    Cheers
    Andy
    www.andypope.info

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.2.0