hi. I have two tables in two different sheets. I want to filter one of the tables based on the selection of a cell in the other. they both share the same order of headings. Once it's filtered a copy of the filtered range will be pasted next to the other table. then if any entry in this filtered range is selected, both entries in both tables will be highlight with a unique colour. this is what i've come up with so far. I hope someone can help me.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
Sheets("X").Range("$A$1:$C$2000").AutoFilter Field:=1, Operator:= _
xlFilterValues, Criteria2:=Array(2, Sheets("DetailedTable").ActiveCell.Value)
Sheets("X").Range("$A$1:$C$2000").AutoFilter Field:=3, Criteria1:=Sheets("DetailedTable").ActiveCell.Value
Sheets("X").Range("$A$1:$C$2000").AutoFilter Field:=2, Operator:= _
xlFilterValues, Criteria2:=Array(2, Sheets("DETAILEDTable").ActiveCell.Value)
Sheets("X").Range("$A$1:$D$2000").AutoFilter Field:=4, Operator:= _
xlFilterNoFill
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("DETAILEDTable").Select
Range("F1").Paste
End Sub