Consulting

Results 1 to 4 of 4

Thread: Filter change dynamically

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Exclamation Filter change dynamically

    Good morning,


    I'm new to the forum and also to VBA development.
    Need to develop a macro to change filters (one by one) in a dynamic table according to a timer.
    Developed a principle, but do not know how to continue, or carry.


    Dim Alarm
    Const IntervaloSegundos = '5 5 second intervals
    
    Sub Start ()
        Alarm TimeSerial = Now + (0, 0, IntervaloSegundos)
        Application.OnTime EarliestTime: = Alarm, procedure: = "Macro1", Schedule: = True
    End Sub
    
    Sub Macro1 ()
        Call Log
        Call changeFilter ("Name", "Table1")
    End Sub
    
    Sub changeFilter (ByVal filter As String, ByVal table As String)
        The PivotTable Dim pt
        Set pt = Worksheets ("Sheet2"). PivotTables (table)
        pt.PivotFields (filter). ClearAllFilters
        pt.PivotFields (filter). CurrentPage = "Test" 'New filter set but grin. At this point I would make a loop to go through all filters.
    End Sub

    Help me please.
    Thanks =D
    Last edited by Zack Barresse; 12-20-2013 at 10:43 AM. Reason: Added VBA tags

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •