Option Explicit
Sub Einblenden()
Dim PWort, PWEingabe, Fehler
PWort = "Test"
Fehler = 1
nochmal:
PWEingabe = InputBox("Bitte geben Sie das Paßwort ein" + Chr(10) + "Das Paßwort lautet: Test", "Paßwortabfrage")
If PWEingabe <> PWort Then
If Fehler < 4 Then
If Fehler = 1 Then
MsgBox "Sie haben noch 3 Versuche", _
vbOKOnly, "Falsche Eingabe"
ElseIf Fehler = 2 Then
MsgBox "Sie haben noch 2 Versuche", _
vbOKOnly, "Falsche Eingabe"
ElseIf Fehler = 3 Then
MsgBox "Sie haben noch 1 Versuch", _
vbOKOnly, "Falsche Eingabe"
Else
End If
Fehler = Fehler + 1
GoTo nochmal
Else
MsgBox "Der Zugriff wurde verweigert!", vbOKOnly, "Indentifikationsfehler"
End If
Else
Sheets("Blatt1").Visible = True
Sheets("Blatt2").Visible = True
End If
End Sub
Vielen Dank im vorraus.
PS: Antwort kann dauern, da ich am Samstag wegfliege. (Endlich Urlaub)