View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Paul C Paul C is offline
external usenet poster
 
Posts: 269
Default Determine when Enter Key is pressed in a sheet??

The Enter Key is not a capturable event.

Worksheet change is
This added to the individual worksheet in VBA will trigger when ever the
sheet is changed.

Private Sub Worksheet_Change(ByVal Target as Range)
'Do Stuff
End Sub

If you are going to make changes to the sheet using this event is is usually
a good idea to turn off events at the start and then turn them back on at the
end. Otherwise the changes trigger this macro again.

Private Sub Worksheet_Change(ByVal Target as Range)
Application.EnableEvents=False
'Do Stuff
Application.EnableEvents=True
End Sub




--
If this helps, please remember to click yes.


"Subodh" wrote:

I want to determine when Enter key is pressed in a sheet that is
active??
I would like then to run a macro when the Enter key is pressed ??
.