AW: automatische Textbox
11.10.2007 16:45:21
Andi
Hi,
die Eingabe in den TextBoxen muss mit Enter abgeschlossen werden:
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode 13 Then Exit Sub
If Not IsNumeric(TextBox1.Value) Then
TextBox1.Value = ""
MsgBox "Bitte eine Zahl eingeben"
Exit Sub
End If
If TextBox2.Value "" Then TextBox3.Value = TextBox1.Value * TextBox2.Value
TextBox2.SetFocus
End Sub
Private Sub TextBox2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode 13 Then Exit Sub
If Not IsNumeric(TextBox2.Value) Then
TextBox2.Value = ""
MsgBox "Bitte eine Zahl eingeben"
Exit Sub
End If
If TextBox1.Value "" Then TextBox3.Value = TextBox1.Value * TextBox2.Value
TextBox1.SetFocus
End Sub
Schönen Gruß,
Andi