Hallo tscharl,
habe den Code von dir noch einmal twas abgeändert, jetzt machen die 3 textboxen das was sie sollen.
Hier die änderungen:
Private Sub Berechne()
Dim n As Integer
TextBox1.Text = 0
TextBox2.Text = 0
TextBox3.Text = 0
For n = 1 To 18
If Me.Controls("Bahn" & n).Text = 1 Then
TextBox1.Text = TextBox1.Text + 1
End If
If Me.Controls("Bahn" & n).Text > 2 And IsNumeric(Me.Controls("Bahn" & n).Text) Then
TextBox2.Text = TextBox2.Text + Val(Me.Controls("Bahn" & n).Text) - 2
End If
If IsNumeric(Me.Controls("Bahn" & n)) Then
TextBox3.Text = TextBox3.Text + Val(Me.Controls("Bahn" & n).Text)
End If
Next n
End Sub
-------------------------------------------------------------------------------------------------------------------------------
Und:
Private Sub UserForm_Initialize()
strWeiterSo = "Mach weiter so, dann schaffst du die Bahnen unter 18."
strFehler = "Du hast nur 6 Schläge!"
strHinweis = "Bitte gültigen Wert eingeben."
Dim n As Integer
For n = 1 To 18
Me.Controls("Bahn" & n).Text = "?"
Next n
TextBox1.Text = 0
TextBox2.Text = 0
TextBox3.Text = 0
End Sub
-----------------------------------------------------------------------------------------------------------------------------
Vieleicht hast Du ja noch eine Lösung für meine Comond Button ;)
Gruß Chrimaet
|