+ Reply to Thread
Results 1 to 7 of 7

VBA / update PivotTable source data

  1. #1
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    VBA / update PivotTable source data

    Hi,

    I'm attempting to update a pivotTable's source data and I'm getting the "Run-time error '9':" error. Can any of you tell me what's wrong with my code? I've posted it below, and created it using the macro recorder and then altering it in the VBE. Thanks for your help.


    Please Login or Register  to view this content.
    BrownBoy

    If happy, mark "SOVLED" & add to "REP"

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2010
    Posts
    2,308

    Re: VBA / update PivotTable source data

    change your code to this....I believe this will work

    OLD

    Please Login or Register  to view this content.
    NEW
    Please Login or Register  to view this content.
    untested
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Re: VBA / update PivotTable source data

    Thanks for the attempt, but it didn't work. It was missing a ")". My adjustment to your code is below with the added ")". Any other ideas?

    Yours:
    Please Login or Register  to view this content.
    With ")":
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Re: VBA / update PivotTable source data

    Here is made up version of what I'm trying to do. The pivottable is on the first sheet and the data is on the second.

    BunnyPay.xlsx

  5. #5
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2010
    Posts
    2,308

    Re: VBA / update PivotTable source data

    Please Login or Register  to view this content.
    Let's try this

  6. #6
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2010
    Posts
    2,308

    Re: VBA / update PivotTable source data

    did this help?

  7. #7
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Re: VBA / update PivotTable source data

    It didn't work. Whenever I include the sheet location and cell range in the same line of VBA code I always get errors. I decided to select the sheet first then the range. Thanks anyways.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 01-07-2013, 12:22 PM
  2. Change source data of existing PivotTable
    By fecurtis in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-02-2008, 11:41 AM
  3. [SOLVED] OLE automation with PivotTable and external Data Source
    By Kam in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-28-2006, 08:30 PM
  4. [SOLVED] PivotTable with No Source Data
    By k.vanderstarren@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-23-2006, 01:45 PM
  5. Select different source data for a PivotTable
    By chetoos in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-08-2005, 03:05 PM

Tags for this Thread

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