View Single Post
 
Old 07-19-2018, 06:19 AM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2016
Expert
 
Join Date: Apr 2014
Posts: 956
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Since you have the criteria range in its own 'white space'', you can use CurrentRegion to determine its extent, so you only need one line (you don't need the Dims because the code is inside the sheet's own code-module so all unqualified ranges refer definitively to that same sheet):
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("B12:C24").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=Range("B3").CurrentRegion, Unique:=False
End Sub
Reply With Quote