Results 1 to 4 of 4

Pivot table not updating when using data validation

Threaded View

  1. #1
    Registered User
    Join Date
    07-21-2015
    Location
    West Midlands
    MS-Off Ver
    2010
    Posts
    43

    Pivot table not updating when using data validation

    Hi,
    I have some code that is trying to update my pivot table, but when I select a dropdown i have to come off it and click the cell to update the data. Please could anyone help? I have searched but cant find anything that matches what I am trying to do. All i want it for it to update when i select one of the dropdowns. The code is below.

    Thank you

    Sub Worksheet_SelectionChange(ByVal Target As Range)
    
    If Intersect(Target, Range("B3")) Is Nothing Then Exit Sub
     
    Dim pt As PivotTable
    Dim Field As PivotField
    Dim NewCat As String
    
    
    Set pt = Worksheets("Pivot").PivotTables("PivotTable1")
    Set Field = pt.PivotFields("Month Name")
    NewCat = Worksheets("Report").Range("B3").Value
    With pt
    Field.ClearAllFilters
    Field.CurrentPage = NewCat
    pt.RefreshTable
    End With
    
    End Sub
    Last edited by aimone111; 07-30-2015 at 04:45 AM. Reason: Code Was not code tagged

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Problems updating Pivot Table with new data
    By Andres007 in forum Access Tables & Databases
    Replies: 1
    Last Post: 07-30-2014, 09:39 AM
  2. Help with Pivot table data updating issue
    By lgc.fico in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-24-2013, 10:56 PM
  3. Updating Two Pivot Filters based on Two Data Validation Cell Text
    By garam082981 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-13-2012, 01:21 PM
  4. Replies: 0
    Last Post: 09-01-2011, 04:25 PM
  5. [SOLVED] updating a pivot table with current year's data
    By Takeadoe in forum Excel General
    Replies: 2
    Last Post: 03-30-2006, 04:30 PM
  6. [SOLVED] Updating Pivot Table Column Date Data
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-18-2005, 11:05 AM
  7. [SOLVED] Updating source data while in Pivot Table
    By Carim in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-27-2005, 10:06 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