VBA Filter

stanco

New Member
Joined
Mar 16, 2019
Messages
48
Hi, i need some help on two matters. both are related to filters, involving dates and multiple column.

a sample of my database as such:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Project[/TD]
[TD]Gender[/TD]
[TD]Type[/TD]
[TD]Funding[/TD]
[TD]Topic[/TD]
[TD]Date of Application[/TD]
[TD]Survey Date 1[/TD]
[TD]Survey Date 2[/TD]
[TD]Survey Date 3[/TD]
[TD]Survey Date 4[/TD]
[TD]Survey Date 5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

i need to generate two lists from this database quite frequently and i am hoping to automate it.

the first list is relative simple, i just need to filter gender and date of application, and i am hoping to extract all the corresponding rows into a fresh sheet whenever i key in the date range (at the fresh sheet itself). for example,

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Application Start Date[/TD]
[TD]dd/mm/yyyy[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Application End Date[/TD]
[TD]dd/mm/yyyy[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Project[/TD]
[TD]Topic[/TD]
[TD]Date of Application[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


the second list is more "complicated". the surveys are done on an adhoc basis so some might be on survey 4 but some might be on their first or not even started yet. i need to filter the rows based on a date range for the survey columns (starting from the second survey onward) that falls between the date range. (is this even possible?)

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Start Date[/TD]
[TD]12/02/2019[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]End Date[/TD]
[TD]18/03/2019[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Project[/TD]
[TD]Gender[/TD]
[TD]Topic[/TD]
[TD]Survey Date 2[/TD]
[TD]Survey Date 3[/TD]
[TD]Survey Date 4[/TD]
[TD]Survey Date 5[/TD]
[/TR]
[TR]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]150/2019[/TD]
[TD]03/03/2019[/TD]
[TD]15/03/2019[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]03/03/2019[/TD]
[TD]04/03/2019[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]08/03/2019[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]16/03/2019[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


or is there any better way to do this? appreciate your help and suggestions on this please!
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Start Date[/TD]
[TD]12/02/2019[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]End Date[/TD]
[TD]18/03/2019[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Project[/TD]
[TD]Gender[/TD]
[TD]Topic[/TD]
[TD]Survey Date 2[/TD]
[TD]Survey Date 3[/TD]
[TD]Survey Date 4[/TD]
[TD]Survey Date 5[/TD]
[/TR]
[TR]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD][/TD]
[TD]03/03/2019[/TD]
[TD]15/03/2019[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]03/03/2019[/TD]
[TD]04/03/2019[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]08/03/2019[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]XXX[/TD]
[TD]16/03/2019[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

sorry, i cannot edit my earlier post, but the second list should be like this. it should shows all the details and the dates of the surveys that meet the date range. for earlier surveys that were done outside of the date range, it should not be shown.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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