habe folgenden Code`gebastelt, der soll sich aber nach drei Fehlversuchen schließen.
Wie bekommt man das am besten hin?
Mit dem Code hier läuft die MsgBox hintereinander ab. Es sollen aber drei Versuche bei TextBox möglich sein. Also TextBox eingabe dann Button klicken - falsch - noch zwei Versuche, dann nochmal usw.
Vielen Dank.
Gruß Amina
Private Sub CommandButton4_Click()
If TextBox11.Text = "Test" Or TextBox11.Text = "Test1" Then
Application.Width = 1437.75
Application.Height = 786.75
Application.WindowState = xlMaximized
Unload UserForm1
Else: MsgBox ("Falsches Passwort - Noch zwei Versuche")
If TextBox11.Text = "Test" Or TextBox11.Text = "Test1" Then
Application.Width = 1437.75
Application.Height = 786.75
Application.WindowState = xlMaximized
Unload UserForm1
Else: MsgBox ("Falsches Passwort - Noch einen Versuch")
If TextBox11.Text = "Test" Or TextBox11.Text = "Test1" Then
Application.Width = 1437.75
Application.Height = 786.75
Application.WindowState = xlMaximized
Unload UserForm1
Else: MsgBox ("Falsches Passwort - Programm wird geschlossen.")
End If
End If
End If
End Sub