Hallo
dann integriere die Passwort Abfrage in den Passwort Code. Wenn er noch an anderer Stelle im Original benötigt wird schreib für den Button einen neuen Code wie unten. Damit sollte es problemlos klappen
mfg Nobody
Private Sub Kennwortschutz_Button_BeiKlick()
'Hier InputBos mit Passwort Abfrage
PWort = InputBox("Bitte Passwort angeben")
If PWort = Empty Or PWort <> "Passwort" Then GoTo Fehler
On Error GoTo Fehler
If ActiveSheet.ProtectContents = False Then GoTo Fehler
ActiveSheet.Unprotect
CommandButton2.Visible = True
CommandButton3.Visible = True
CommandButton4.Visible = True
Exit Sub
Fehler:
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowSorting:=True, AllowFiltering:=True, Password:=("KdoSAN")
CommandButton2.Visible = False
CommandButton3.Visible = False
CommandButton4.Visible = False
On Error GoTo 0
End Sub
|