If you mean, can you run a macro after you've started to enter something into a cell, but before you hit the [Enter] key, then no. While in Edit mode you cannot execute a macro.
If you mean, can you trap for certain values having been entered into a cell after you hit the [Enter] key and you back out of Edit mode then yes, you can use the _Change() event handlers to take some action based on what was entered into a cell.
What I am trying to do is enter things into a TEXTBOX, not a cell. each keystroke will give a Change event. I want to look at each keyboard entry at that change event to determine if it was the enter key that was depressed. is this possible?
Maybe yes, maybe no; you need to clarify 2 points first:
What kind of TextBox are you talking about? AutoShape? Forms on sheet? ActiveX on sheet? Userform? What?
Why are you interested in the Enter key? Because it's the Enter key? Or because you want to monitor when the TextBox is exited? If so, what about the Tab key, which will also allow for TextBox exit? You might need an Exit event instead.
So you see, a little more info from you would go a long way to getting an answer.
Look, I am trying to use a control box created text box to enter some data. I dont want to use it on a user form. I would like the user to be able to enter whatever they want, then press the enter key and have a macro then shift the focus of that control box created text box onto another one. All I am trying to find out is if this is possible and if so, how to do it. The change event for the text box detects any keystroke. At each change event, I would like to look at what that change was and then initiate code.
Here's the code for hitting Enter in a an ActiveX TextBox. The code goes in the worksheet module upon which the TextBox resides. Modify for name of TextBox.
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = vbKeyReturn Then
MsgBox "It's your thang..." & vbCrLf & "Do whatcha wanna do...", 64, "Enter was clicked."
KeyCode = 0