I am trying to display two tables in my worksheet. Table1 and Table2 are identical and I am trying to use advanced filter to filter the tables based on two different criteria.
This works with one filter and with two filters with the worksheet change function.
However, it only works if I offset table2 a couple of rows so that identical lines are not filtered which makes the tables look the same. This ruins my layout and I am looking for some way to display two tables in a worksheet.
In this thread on mrexcel.com / forum/excel-questions/398567-multiple-advanced-filters-worksheet_change-event-functionality.html ( I have cross posted in this thread!)
there is a solution for one table but I would like help to use the xlFilterCopy action for two tables. Is this possible?
I am copying the code (this is not my code) from that thread:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rgCriteria As Range, rgList As Range
Set rgList = Range("A5:C9")
Set rgCriteria = Range("B1:C2")
If Not Intersect(Target, rgCriteria) Is Nothing Then
rgList.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=rgCriteria, Unique:=False
End If
End Sub
And perhaps there is another way to include several columns and several rows from two different tables into another worksheet?
Bookmarks