Thema Datum  Von Nutzer Rating
Antwort
Rot Millionenshow Problem
29.05.2014 11:18:19 phx
NotSolved
29.05.2014 11:34:40 Gast79372
NotSolved
29.05.2014 12:30:04 phx
NotSolved
29.05.2014 11:41:06 phx
NotSolved
29.05.2014 12:02:03 Gast65797
NotSolved
29.05.2014 12:06:01 Gast43674
NotSolved
29.05.2014 12:14:59 phx
NotSolved
29.05.2014 12:43:07 phx
NotSolved
29.05.2014 13:52:09 phx
*****
NotSolved

Ansicht des Beitrags:
Von:
phx
Datum:
29.05.2014 11:18:19
Views:
1342
Rating: Antwort:
  Ja
Thema:
Millionenshow Problem

Hallöchen, ich häng hier bei einem ziemlich einfachen, aber für mich doch irgendwie unlösbaren Problem fest.
Ich bin gerade dabei eine Millioneneshow mit VBA zu machen und habe in die Arbeitsmappe die Frage, die vier Antworten und die richtige Antowrt in jeweils eine Zelle geschrieben. 

Und nun das was ich haben möchte: Wenn man eine Frage richtig beantwortet hat, erscheint der Commandbutton5 mit der Aufschrift "Nächste Frage".
Wenn man diesen anklickt soll die gesamte Zellen angabe um eins herunterrutschen um die nächsten Fragen und Antworten einzublenden.

Ich hoffe ihr könnt mir helfen:

Code ist folgender: Das i soll bei jedem Klick auf den Commandbutton5 um eins größer werden

 

Dim i As Integer
 
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()
 
 
Ich hoffe auf hilfreiche Antworten. Danke im Voraus

 

 


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
Rot Millionenshow Problem
29.05.2014 11:18:19 phx
NotSolved
29.05.2014 11:34:40 Gast79372
NotSolved
29.05.2014 12:30:04 phx
NotSolved
29.05.2014 11:41:06 phx
NotSolved
29.05.2014 12:02:03 Gast65797
NotSolved
29.05.2014 12:06:01 Gast43674
NotSolved
29.05.2014 12:14:59 phx
NotSolved
29.05.2014 12:43:07 phx
NotSolved
29.05.2014 13:52:09 phx
*****
NotSolved