Filter based on cell value

Sumilidon

New Member
Joined
Jan 16, 2012
Messages
2
Morning all,
I am hitting a bit of a wall with regards to a recent project and hoping you could help.
In short, I have a database of over 500,000 rows that I want to search based upon multiple criteria. I tried using a Countif solution which works, but it’s so resource heavy that the end users just crash their tiny PCs.



I was therefore hoping to use a filter solution



Sheet 1 contains the data to be searched:
Column A contains a unique reference number
Column E contains a Date of Birth
Column I contains a Postcode



Sheet 2 contains the input data the end user wants searches
Column A is where they add any references numbers they have (up to 20)
Column B is where they add any DOBs they have (up to 20)
Column C is where they add any Postcodes they have (up to 20)



I want it so that on Sheet 2, the end user can type in any references they may have into 1 column, any dates of birth in the second and any postcodes in the third. They press a button, a Macro runs and applies a Filter on Sheet 1 for the above.



To make matters more complex, I want it to return any rows with at least 1 match and for the Unique Reference and Postcode filters to be a "contains" rather than exact match. This means it must also include blanks



Normally I would just record a macro and manually do it the first time, but it won’t allow me to select a cell reference and as said, I used the Countif method which works excellently – but because of the file size is far too resource heavy.
Any help appreciated
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
You could consider using the Advanced Filter functionality (not part of the Autofilter criteria but a separate feature under the Data / Sort & Filter menu)


  1. You would want to select "Filter the list, in place" as the Action
  2. The database in Sheet1 would be your List Range
  3. Sheet 2 is where you'd locate the Criteria Range, which would need:
    • 3 columns for the search criteria (Ref, DOB, Postcode) with exactly the same column headings as on Sheet1, and
    • 60 rows because I'm assuming you want to see all rows where the Ref. No, DOB or Postcode match (rather than combinations of Ref and DOB and Postcode) The values in these "fields" can also use wildcards for your "contains" searches.
  4. It's a while since I've run an Advanced Filter, but I remember that when the List Range and Criteria Range are on different sheets, you need to select one of them first (but can't recall which one, sorry).
  5. You could record a macro when you have the process sorted, and link it to a button which the the users could click once they've entered their search data.
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

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