zakizelani
New Member
- Joined
- Mar 3, 2016
- Messages
- 25
hi i was wondering if anyone can edit my code. the code here only filter if the data only if it begins with what the user input
Example:
Data:
dean winchester
sam winchester
john winchester
mary winchester
Now -
input: winchester
result: no data
want:
input: winchester
result: dean winchester
sam winchester
john winchester
mary winchester
Example:
Data:
dean winchester
sam winchester
john winchester
mary winchester
Now -
input: winchester
result: no data
want:
input: winchester
result: dean winchester
sam winchester
john winchester
mary winchester
Code:
Private Sub CommandButton1_Click()
Sheets("Database").Range("A:AG").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("Background").Range("G2:H3"), CopyToRange:=Range( _
"A5:AG5"), Unique:=False