|
こんにちは
これではどうでしょう?
Private Sub CommandButton1_Click()
MsgBox "ボタン1"
End Sub
Private Sub CommandButton1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = vbKeyReturn Then
Call CommandButton1_Click
End If
If KeyCode = vbKeyTab Then
CommandButton2.Activate
End If
End Sub
Private Sub CommandButton2_Click()
MsgBox "ボタン2"
End Sub
Private Sub CommandButton2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = vbKeyReturn Then
Call CommandButton2_Click
End If
If KeyCode = vbKeyTab Then
CommandButton1.Activate
End If
End Sub
やってみたら出来てるような・・・・
ところで、
Call CommandButton1_Click
こんな風に、コントロールのイベントを呼ぶ出すのってOKなのかな?
|
|