ENTER keys to execute code to add menu

M

Mark Warner

I looked through the previous topics but didn't see what I need.

I want that when a person hits the enter key in cell C2 that it executes
code to bring up a customized menu. Also WHERE in the code does this go, a
module, or in the SHEET1 objects area?

I have tried this code:

Private_Sub SetKey()
Application.OnKey "~", "supmenu"
Application.OnKey "{ENTER}", "supmenu"
End Sub


Thanks.
 
S

stevebriz

Mark said:
I looked through the previous topics but didn't see what I need.

I want that when a person hits the enter key in cell C2 that it executes
code to bring up a customized menu. Also WHERE in the code does this go, a
module, or in the SHEET1 objects area?

I have tried this code:

Private_Sub SetKey()
Application.OnKey "~", "supmenu"
Application.OnKey "{ENTER}", "supmenu"
End Sub


Thanks.

Is another option to use the worksheet_change and for that cell?

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$C$2" Then
' do stuff here'
End If
End Sub
 

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

Top