I am a novice currently using the following macro to filter an inventory database to find items in excel 2007. It triggers the filter to work if cell a2 is changed.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$2" Then
'
Range("A3:G7951").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
Range("A1:G2"), Unique:=True
End If
End Sub
I also would like cell B2 to trigger the filter if changed so we can filter by A2 and or B2, I have tried repeating the above with to no avail.
Any ideas
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$2" Then
'
Range("A3:G7951").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
Range("A1:G2"), Unique:=True
End If
End Sub
I also would like cell B2 to trigger the filter if changed so we can filter by A2 and or B2, I have tried repeating the above with to no avail.
Any ideas
Last edited: