Here's an approach you might be interested in:
(It's less complicated than it might look)
Assumptions:
Sheet1 contains source data in cells A1:B10 (EmpID's and Ages)
Sheet2 is where you want the extracted data to be displayed
Using Sheet2:
A1: EmpID
B1: Age
From the Excel Main Menu:
I1: EmpID
I2: 24
Still using Sheet2:
(Notice: you are on Sheet2, and creating a Sheet2-level range name, but
the referenced range is on Sheet1)
The reason: An advanced filter cannot SEND data to another sheet, but
it can PULL data from another sheet.
Now...set up the Advanced Data Filter:
<Data><Filter><Advanced Filter>
Select: Copy to another location
List Range: (press F3 and select Database)
Criteria Range: (press F3 and select Criteria)
Copy To: (press F3 and select Extract)
Click [OK]
Note: if you want to run that Advanced Data Filter repeatedly,
you'll need to re-select Database each time
....OR...if you're feeling a bit ambitious...
You can build a simple macro to automatically re-run the filter:
Press [Alt]+[F11] to open the VBA editor
Right click on the VBA Project folder for your workbook
Select: Insert>Module
Then, copy/paste this code into that module:
To run the code:
To test, change the value of I2 and run it again.
Is that something you can work with?
Bookmarks