KeyDown event in sheet

  • Thread starter Thread starter Peter Wallin
  • Start date Start date
P

Peter Wallin

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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top