Link to home
Start Free TrialLog in
Avatar of Steve_Brady
Steve_BradyFlag for United States of America

asked on

Real-time filtering in Excel

Hello,

This is a follow-up question to an already-resolved thread located here:
https://www.experts-exchange.com/questions/28247088/Code-to-create-filtering-box-at-the-top-of-several-columns-in-Excel.html

In that thread, a VBA solution was provided which enables a single row of cells, located just above the column headings row of a table of data, to be used for two-step filtering. In other words, without the need to open any filtering boxes from the ribbon or quick access toolbar, a filtering criterion can be entered directly into a cell (1st step) and then by simply pressing {Enter} (2nd step), the filtering is done.

With that code now available, the purpose of this thread is to inquire about the feasibility of turning the above-mentioned two-step filtering process into a one-step process. In other words, is it possible to eliminate the 2nd step mentioned above (pressing {Enter}) so that real-time filtering occurs as you are entering a filtering criterion? This would be identical to the dynamic process which takes place when a drop-down auto-filtering box is open and the list of possible matches automatically adjusts in response to each new character entered into the search box.

Thanks
Avatar of FamousMortimer
FamousMortimer
Flag of United States of America image

Hi Steve,

Unfortunately, there is no worksheet event to handle a keystroke in a cell.  The code from the previous question uses the worksheet change event which fires after a cell is committed (i.e. when enter is pressed).  For something like that you would have to use another solution such as a VB/C# project using a datagridview that can handle many more events.
Avatar of Martin Liss
Add this to your code which will send 'Enter'

SendKeys "~"
SOLUTION
Avatar of FamousMortimer
FamousMortimer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Steve_Brady

ASKER

Many thanks.
You're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2013