+ Reply to Thread
Results 1 to 3 of 3

Macro to filter based on a master sheet

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Macro to filter based on a master sheet

    Heres something to start with:

    Sub ASD()
    
    Dim Worksheet As Worksheet
    Dim sName As String
    
    sName = Sheets(1).AutoFilter.Filters(1).Criteria1
    sName = Right(sName, Len(sName) - 1)
    
    For Each Worksheet In ThisWorkbook.Worksheets
        If Not Worksheet Is ActiveSheet Then
            If Worksheet.FilterMode = True Then Worksheet.ShowAllData
            Worksheet.Range("A1").AutoFilter Field:=1, Criteria1:=sName
        End If
    Next Worksheet
    
    End Sub
    This is a mere macro - no event procedure. A quick google tells me that you have to get creative when it comes to when to trigger this code.
    There is no event thats associated with a filter change. One way is to create a formula in one cell that will trigger the Worksheet_Calculate event every time you change the filter.
    Perhaps someone can chip in here as I'm to lazy to do the rest : - )
    If you think that my answer was helpful, please click on the "Add to this user's Reputation" button.

  2. #2
    Registered User
    Join Date
    03-22-2014
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macro to filter based on a master sheet

    Perhaps you can help me in a detailed way. This actually bounced.

+ 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. Filter data from a Master sheet based on multiple criteria by VBA code
    By judeprem in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2013, 03:27 PM
  2. Replies: 2
    Last Post: 05-01-2013, 12:26 PM
  3. Macro to apply a filter from one sheet (a master sheet) to all sheets in workbook
    By SeaniGeld in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-30-2013, 02:00 PM
  4. One filter/ Master filter multiple pivot tables based on worksheet...
    By jlworden in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-10-2013, 11:16 AM
  5. Master Filter Sheet to Filter All Sheets
    By nguyeda in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 12-16-2012, 06:59 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