+ Reply to Thread
Results 1 to 3 of 3

VBA to refresh pivot table if cell values changes

  1. #1
    Forum Contributor
    Join Date
    01-09-2013
    Location
    Saudi arabia
    MS-Off Ver
    Excel 2019
    Posts
    101

    Post VBA to refresh pivot table if cell values changes

    Please suggest me a VBA to refresh pivot table if any value in cells R2 or S2 changes.
    I am using the following VBA but some times apart from 4 pivot 1 is not refreshing.



    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("R2,S2")) Is Nothing Then
    PivotTables(1).RefreshTable
    PivotTables(2).RefreshTable
    PivotTables(3).RefreshTable
    PivotTables(4).RefreshTable
    End If
    End Sub

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,365

    Re: VBA to refresh pivot table if cell values changes

    Hi,

    Have you tried..
    Please Login or Register  to view this content.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    604

    Re: VBA to refresh pivot table if cell values changes

    Does the data in pivot 1 depend on the new data in pivot 2,3,4? You may have to refresh twice if this is the case.

+ 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: 0
    Last Post: 08-14-2013, 06:31 AM
  2. [SOLVED] Using VBA to change a pivot table filter, refresh the report and set up a refresh delay
    By Bonnister in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-18-2012, 10:43 AM
  3. Pivot table - cell format to remain the same when refresh
    By mingali in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-15-2010, 12:01 PM
  4. Date in cell to update upon Pivot Table refresh
    By chris46521 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-17-2006, 06:02 PM
  5. Refresh Pivot Table from other worksheet cell entry
    By ShaneS in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-31-2005, 11:05 AM

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