ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   KeyDown event in sheet (https://www.excelbanter.com/excel-programming/292777-keydown-event-sheet.html)

Peter Wallin

KeyDown event in sheet
 
Hello,
How do I catch the event that occurs when a user presses a key, for
example entering 456 in a cell? I know about application events, but
the events that can be caught using this type of events are limited. I
want to be able to handle other events such as keydown in any sheet in
any workbook. Any suggestions?

Thanks in advance!

peter w.

Flemming Dahl[_2_]

KeyDown event in sheet
 
Hi Peter

No keydown event on sheet - you gotta use Worksheet_Change - e.g. like this

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
MsgBox "Cell A1 has been changed to " & Target.Value
End If
End Sub

Cheers,
Flemming



"Peter Wallin" wrote in message
om...
Hello,
How do I catch the event that occurs when a user presses a key, for
example entering 456 in a cell? I know about application events, but
the events that can be caught using this type of events are limited. I
want to be able to handle other events such as keydown in any sheet in
any workbook. Any suggestions?

Thanks in advance!

peter w.





All times are GMT +1. The time now is 11:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com