View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
SmartWombat SmartWombat is offline
external usenet poster
 
Posts: 1
Default detecting keypress(es) in a cell

I know this is an old, old thread.

What I want is that for cells in the named range Range("WeekDays") that on
typinging "+" the value is increased by 0.25 and on pressing "-" the value
decreased by 0.25.

What's the best way of achieving that in Excel 2003 ?

"Tom Ogilvy" wrote:

Good thought.

Sub SetKey()
Application.OnKey "~", "MyEnter"
Application.OnKey "+~", "MyShiftEnter"
End Sub

Sub UnSetKey()
Application.OnKey "~"
Application.OnKey "+~"
End Sub

Sub MyEnter()
MsgBox "In MyEnter"
End Sub
Sub MyShiftEnter()
MsgBox "In MyShiftEnter"
End Sub

--
Regards,
Tom Ogilvy

"Vic Eldridge" wrote in message
...
I would like to detect the Enter key code and SHIFT+Enter keys

combination.

Application.Onkey can be used to respond to keyboard events.


Regards,
Vic Eldridge