Keyboard button 'event'

CalvinGraham

Board Regular
Joined
Jan 27, 2010
Messages
67
I gather there isn't a way to have an event triggered by the keyboard?

I have a system set up with graphs/tables and a search box so you could enter a value and the filters change. Of course, you could use the fitlers themselves manually but I've set up with sheet for people who don't have a clue about Excel. They should just be able to enter an office/product etc and select the chosen option from a set of cells/results.

Currently this works great except you have to hit Enter. I was really wanting an event like "Keypress" so that it could update after every letter, a bit like Google search. I could use a form but I'd rather keep it streamlined and on the worksheet
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
35,503
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
You can use controls on sheets as well as on forms. or you could just have a little floating form used as a control. Or use menu items.
 

JamesW

Well-known Member
Joined
Oct 30, 2009
Messages
1,197
Hi there,

Can you not use the Selection Change event?

e.g. Office/Product value is in cell A1, option Choice is in B1:

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Not Intersect(Target, Range("A1:B1")) Is Nothing Then
        doStuff
    End If
End Sub
 

CalvinGraham

Board Regular
Joined
Jan 27, 2010
Messages
67
At the moment I've been using the selection change but that means you have to hit enter to leave the cell and invoke the event.

Interesting the thing with controls. I've always used the Forms toolset and frankly not really understood the difference between forms and controls. I found controls better because, say, if you had listbox you can right click, Format Control and there's a Control tab to assign it quickly to the worksheet. Doing a bit of reading based on here suggests that controls are more vb than excel? There's also a Mac compatibility issue I think, not much of an issue normally but my system at home could kick up a fuss if I was working from home
 

JamesW

Well-known Member
Joined
Oct 30, 2009
Messages
1,197
Ahh, sorry Calvin - I misread the OP and thought you wanted an enter event rather than an auto update after every letter...
 

RoseG

New Member
Joined
Dec 14, 2010
Messages
14
Hey

I don't know if I've fully understood what you're asking for but could you set a combobox to appear when the title bar is selected? Typing in this would move you through the attached list as you typed, until a unique match is found.

The filter could be triggered by this unique match, with reference to the selected value.

Does that sound like the sort of thing you're looking for?

Rose
 

Watch MrExcel Video

Forum statistics

Threads
1,108,960
Messages
5,525,911
Members
409,671
Latest member
nasseralateek

This Week's Hot Topics

Top