es geht noch immer nicht:
hier der code nochmal bearbeitet:
Dim i As Long
Private Sub userform_activate()
Label1.Caption = Worksheets("Tabelle1").Cells(i, 1)
CommandButton1.Caption = Worksheets("Tabelle1").Cells(i, 2)
CommandButton2.Caption = Worksheets("Tabelle1").Cells(i, 3)
CommandButton3.Caption = Worksheets("Tabelle1").Cells(i, 4)
CommandButton4.Caption = Worksheets("Tabelle1").Cells(i, 5)
CommandButton5.Visible = False
l = Worksheets("Tabelle1").Cells(i, 6)
CommandButton5.Caption = "Nächste Frage"
End Sub
Private Sub CommandButton1_Click()
If CommandButton1.Caption = Worksheets("Tabelle1").Cells(i, 6) Then
CommandButton5.Visible = True
CommandButton1.BackColor = &HFF00&
Label2.Caption = "Richtig"
Label2.BackColor = &HFF00&
CommandButton2.Visible = False
CommandButton3.Visible = False
CommandButton4.Visible = False
Else
CommandButton1.BackColor = &HFF&
Label2.Caption = "Leider falsch"
Label2.BackColor = &HFF&
End If
End Sub
Private Sub CommandButton2_Click()
If CommandButton2.Caption = Worksheets("Tabelle1").Cells(i, 6) Then
CommandButton5.Visible = True
CommandButton2.BackColor = &HFF00&
Label2.Caption = "Richtig"
Label2.BackColor = &HFF00&
CommandButton1.Visible = False
CommandButton3.Visible = False
CommandButton4.Visible = False
Else
CommandButton2.BackColor = &HFF&
Label2.Caption = "Leider falsch"
Label2.BackColor = &HFF&
End If
End Sub
Private Sub CommandButton3_Click()
If CommandButton3.Caption = Worksheets("Tabelle1").Cells(i, 6) Then
CommandButton5.Visible = True
CommandButton3.BackColor = &HFF00&
Label2.Caption = "Richtig"
Label2.BackColor = &HFF00&
CommandButton1.Visible = False
CommandButton2.Visible = False
CommandButton4.Visible = False
Else
CommandButton3.BackColor = &HFF&
Label2.Caption = "Leider falsch"
Label2.BackColor = &HFF&
End If
End Sub
Private Sub CommandButton4_Click()
If CommandButton4.Caption = Worksheets("Tabelle1").Cells(i, 6) Then
CommandButton5.Visible = True
CommandButton4.BackColor = &HFF00&
Label2.Caption = "Richtig"
Label2.BackColor = &HFF00&
CommandButton1.Visible = False
CommandButton2.Visible = False
CommandButton3.Visible = False
Else
CommandButton4.BackColor = &HFF&
Label2.Caption = "Leider falsch"
Label2.BackColor = &HFF&
End If
End Sub
Private Sub CommandButton5_Click()
i = i + 1
|