Question : On_Enter event in Excel/VBA

Hi guys!
 
 I need to create worksheet or
 workbook event.
 It has to do as follows:
 
 Let's say I activate any cell, then
 type in something (e.g. "Misha1").
 Then I press enter button and it will
 give me a message box with the
 context of the cell, in this case "Misha1".
 Let's create both worksheet and
 workbook event.
 Please, DO NOT use worksheet_change
 or workbook_change event.
 (That's the whole trick.  :-)  )
 
 Please put comments only.
 Watch for the continuation of this
 question for much more points. :-)

Answer : On_Enter event in Excel/VBA

Hi Misha,

"Please, DO NOT use worksheet_change
 or workbook_change event."

What if I tell you it's the only method (maybe with a twist, but it seems to be the only one at this moment to me), which would work well...

Could you expand on the reason for this On_Enter event...

This is what I would be able to do right now:

Sub SetNewEnterProcedure()
Application.OnKey "~", "Test"
End Sub

Sub MishaInBox()
MsgBox(ActiveCell.Value)
End Sub

Run the SetNewEnterProcedure sub once, and then test hitting enter in the worksheet.

To set the enter key behaviour back to default, run this sub

Sub BackToDefault()
Application.OnKey "~"
End Sub

Calacuccia
Random Solutions  
 
programming4us programming4us