+ Reply to Thread
Results 1 to 10 of 10

Call Sub to update specific pivot tables

  1. #1
    Forum Contributor
    Join Date
    08-25-2015
    Location
    London
    MS-Off Ver
    MS 365
    Posts
    213

    Question Call Sub to update specific pivot tables

    Hi all,

    I have a quick question about updating specific pivot tables (on several worksheets) on click of a button. When I click the button, several subs are running (selected using Call) and so far everything is working fine:

    Please Login or Register  to view this content.
    Now, I am trying to get Macro 3 to run...so far without any luck.

    I found several VBA macros online, however, none of them seem to work when 'called'. What I currently have is:

    Please Login or Register  to view this content.
    Note:
    Pivot table is called Pivot_N and is on worksheet Pivot_N, however, I will need to add more pivots on other worksheets to this too...

    Can't seem to get it to work....

    Hope you can help?
    Many thanks!

  2. #2
    Forum Contributor
    Join Date
    08-25-2015
    Location
    London
    MS-Off Ver
    MS 365
    Posts
    213

    Re: Call Sub to update specific pivot tables

    Hi all,

    Any idea on how to solve this? Tried a few things, but no luck yet :-(

    Many thanks

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Call Sub to update specific pivot tables

    What does "can't seem to get it to work" actually mean? Does it cause an error (if so, what and where), or do nothing, or the wrong thing?
    Rory

  4. #4
    Forum Contributor
    Join Date
    08-25-2015
    Location
    London
    MS-Off Ver
    MS 365
    Posts
    213

    Re: Call Sub to update specific pivot tables

    Hi rorya,

    Sorry for the missing detail.

    I get a run-time error 424: object required.

    Not really sure what that means?
    Many thanks!

  5. #5
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Call Sub to update specific pivot tables

    What exactly is Pivot_N? A variable, code name of a sheet, or tab name? Also, it’s Pivottables("Pivot_N") and not Privottables

  6. #6
    Forum Contributor
    Join Date
    08-25-2015
    Location
    London
    MS-Off Ver
    MS 365
    Posts
    213

    Re: Call Sub to update specific pivot tables

    Hi Rorya,

    Ah, thanks for pointing that out. Fixed (but unfortunately same 424 object required error):

    Please Login or Register  to view this content.
    Pivot_N is the worksheet the pivot table "Pivot_N" is on. If it's of any help - each pivot table has a different name, but there is only 1 on each worksheet.
    The following works to update all pivot tables, however, I only want to update specific ones with this macro...

    Please Login or Register  to view this content.
    Is it possible to tweak this to only update pivot tables or worksheets (with pivot tables on) I specify?

    Many thanks for your help!

  7. #7
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Call Sub to update specific pivot tables

    Is Pivot_N the code name of that worksheet, or a worksheet variable, or the tab name? I suspect the latter.

  8. #8
    Forum Contributor
    Join Date
    08-25-2015
    Location
    London
    MS-Off Ver
    MS 365
    Posts
    213

    Re: Call Sub to update specific pivot tables

    It's the tab name

  9. #9
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Call Sub to update specific pivot tables

    Then you need to use:

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    08-25-2015
    Location
    London
    MS-Off Ver
    MS 365
    Posts
    213

    Re: Call Sub to update specific pivot tables

    Hi Rorya,

    Thanks!! I think this works!

    Many thanks for your help!

+ 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. Macro to update pivot table filters from multiple pivot tables of different data sources
    By groblerdn85 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-24-2017, 05:10 AM
  2. How to update a lot of pivot tables at once
    By pgft in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 11-11-2014, 06:09 AM
  3. Pivot tables update with VBA
    By sehested in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-23-2014, 07:26 PM
  4. [SOLVED] VBA to create / update pivot tables
    By cobwebs in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-15-2014, 03:36 PM
  5. Update all pivot tables
    By randolphoralph in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-23-2012, 12:49 PM
  6. Update all pivot tables based on 1st
    By spbready in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2009, 12:00 PM
  7. Auto update pivot tables
    By houstonguy in forum Excel General
    Replies: 2
    Last Post: 01-31-2008, 05:04 PM

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