This question is a follow-up to a thread found here:
I'm hoping someone can create a VBA code which will enable the placement of a row of "filtering" cells atop a range of data in an Excel spreadsheet. The functionality in this row of cells would be exactly the same as the search box in the drop-down menu when using basic filtering, as shown here (Fig. 1):
To illustrate, suppose you have a spreadsheet which contains the table shown in Fig. 2:
In this table, column headings are displayed in row 2 and the data is found in the range B4:H13. The objective is to have an additional row (row 3 in this case) in which search criteria can be inserted for any column.
For example, suppose you want to filter the table so that only individuals less than age 40 are displayed. Therefore, when that entry is made in search cell F3, all rows which do not meet that criterion are hidden (Fig. 3):
Next, suppose you want to decrease the number of displayed rows further by filtering for males. This would be done by entering the criterion in cell D3 (Fig. 4):
I realize that this type of filtering can be accomplished using advanced filtering. However, that process seems to require multiple steps each time you want to change filtering criteria. I'm hopeful that VBA code can be written so that nothing more is required than entering search criteria into a designated row.