i need to filter data that contain what the user's input, not only begins with user's input or exact

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


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
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Example:winchester
Data:
dean winchesterdean winchester1.00000005
sam winchesterbill winchester1.00000006
john winchesterfred winchester1.00000007
mary winchesterdean london0
dean liverpool0
harry winchester1.0000001
Now -
input: winchester
result: no data
the first 1 is
want:=IF(ISERROR(SEARCH($E$1,E5)),0,1+ROW()*0.00000001)
input: winchester
result: dean winchester
sam winchesternow take the largest values that are greater than zer0
john winchesterand use offset match to get the names
mary winchester
11.0000001harry winchester
21.00000007fred winchester
31.00000006bill winchester
41.00000005dean winchester
5
6

<colgroup><col><col span="3"><col><col><col span="4"></colgroup><tbody>
</tbody>
 
Upvote 0
hi, thanks for the reply. is it possible for to explain to me whats you trying to say? btw is it possible if you provide me a vba code for this.
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,858
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top