Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A simplified version of my problem. Consider a single command button on a
blank worksheet. I want to be able execute the command button Click event with both the Return key and a mouse click. I want to be able to clear the message box with both the Return key and a mouse click. If I try to clear the message box with the Return key, it also executes the command button Click event again. So using the Return key to clear the message box puts you into a loop. Any ideas are greatly appreciated. Thanks, Tom 'In ThisWorkbook Private Sub Workbook_Open() Sheet1.Button1.Activate End Sub 'In Sheet1 Private Sub Button1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) Select Case KeyCode 'Return is only key press that we care about Case vbKeyReturn Call Button1_Click End Select End Sub Private Sub Button1_Click() MsgBox "I am stuck in a loop when I use the Return key to clear this message box" & vbNewLine & "but everything is fine if I use a mouse click to clear this message box" End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2007 Form Control/ActiveX Control font difference | Excel Discussion (Misc queries) | |||
publish activeX combobox and other activeX control | Excel Programming | |||
Help with using an activex control | Excel Programming | |||
Loop with activeX optionbuttons. | Excel Programming | |||
How to control "Date Time Picker ActiveX Control" | Excel Programming |