AW: CommandButton in UserForm doppelt belegen?
25.05.2007 20:04:35
Matthias
Hallo Lenhard,
so könnte es gehen:
Private Sub CommandButton1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As _
Integer)
If Shift = 2 Then CommandButton1.Caption = "Befehl2"
End Sub
Private Sub CommandButton1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) _
CommandButton1.Caption = "Befehl1"
End Sub
Private Sub CommandButton1_Click()
If CommandButton1.Caption = "Befehl1" Then
MsgBox "Befehl1"
Else
MsgBox "Befehl2"
CommandButton1.Caption = "Befehl1"
End If
End Sub
Private Sub UserForm_Activate()
CommandButton1.Caption = "Befehl1"
End Sub
Evtl. musst du die KeyDown()- und KeyUp()-Ereignisse noch für andere Elemente definieren.
Gruß Matthias