• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Automating PowerPivot Slicers with Macro or VBA code

Hi Ninjas,

I routinely export data from SqL into Excel using PowerPivot.
The Powerpivot report (template) already contains several Slicers , but just like all Pivot tables, you need to manually REFRESH (or Refresh All) whenever the data from SQL changes and the report is ran.

Is there a macro that can help to automatically refresh the PowerPivot report (like a button) - Please note, the issue here is for Slicers to be updated automatically with any changes in data from SQL?

or

In the attached file, there is a code that automates the pivot table. This is because the data is coming directly from a worksheet in Excel, and not in SQL, like my issue above.

Is there a way to tweak the code if the "data table" came directly from SQL?
 

Attachments

  • auto-refresh-pivot-table.xlsm
    19.9 KB · Views: 9
Hi Prinze,

See the file. You can update the data in rng & slicers would automatically update.

Regards,
AM:)
 

Attachments

  • auto-refresh-pivot-table by Prinz Jaymes.xlsm
    23.8 KB · Views: 21
Back
Top