+ Reply to Thread
Results 1 to 2 of 2

Depending on cell content a pivot table filter should be initiated if data meets list

  1. #1
    Registered User
    Join Date
    06-10-2014
    Posts
    2

    Depending on cell content a pivot table filter should be initiated if data meets list

    i have tried below script but it doesn't activate the filters on Pivottable2.
    Does anyone have an idea?

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Application.ScreenUpdating = False

    If Target.Count > 1 Then Exit Sub
    On Error GoTo ErrHandler
    If Not Intersect(Target, Range( _
    "c6:g8")) Is Nothing Then
    Application.EnableEvents = False
    Range("A13").Value = Range("B" & ActiveCell.Row)
    Range("B13").Value = Range("A" & ActiveCell.Row)
    Range("A14").Value = Cells(5, ActiveCell.column)
    Range("B14").Value = Cells(4, ActiveCell.column)
    End If

    Dim Checklist As Variant
    Checklist = Array("Sep", "Oct", "Nov", "Dec", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "2016", "2017", "2018")


    If Checklist.exists(Range("B13").Value) Then
    ActiveSheet.PivotTables("PivotTable2").PivotFields("order year").CurrentPage = Range("B13").Value
    End If
    If Checklist.exists(Range("A13").Value) Then
    ActiveSheet.PivotTables("PivotTable2").PivotFields("order Month").CurrentPage = Range("A13").Value
    End If
    If Checklist.exists(Range("A14").Value) Then
    ActiveSheet.PivotTables("PivotTable2").PivotFields("delivery year").CurrentPage = Range("B14").Value
    End If
    If Checklist.exists(Range("B14").Value) Then
    ActiveSheet.PivotTables("PivotTable2").PivotFields("delivery month").CurrentPage = Range("A14").Value
    End If


    ErrHandler:
    Application.EnableEvents = True
    Application.ScreenUpdating = True
    End Sub

  2. #2
    Registered User
    Join Date
    06-10-2014
    Posts
    2

    Re: Depending on cell content a pivot table filter should be initiated if data meets list

    Below picture might help to explain were i am looking for:
    addition.jpg

+ 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. Help: Linking a pivot table report filter to a data validation list in another sheet
    By GlobeTrotter5389 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2016, 11:12 AM
  2. Set a filter in a table depending on content of cell
    By fxmu in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-14-2015, 09:55 PM
  3. Replies: 1
    Last Post: 07-16-2015, 05:46 AM
  4. Change cell content depending on selection from drop down list
    By mack4n in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-16-2015, 04:17 AM
  5. Replies: 1
    Last Post: 04-03-2015, 06:00 PM
  6. Replies: 6
    Last Post: 07-31-2014, 12:56 PM
  7. Replies: 3
    Last Post: 11-19-2012, 11: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