HERBERS Excel-Forum - das Archiv

Thema: Blattschutz aufheben

Blattschutz aufheben
Werner

Moin, kann mir jeman helfen, habe hier das bei meinem Ecxelprogramm eingefügt, aber bräuchte auch das Gegenstück und bekomme es nicht hin.
Option Explicit ' Immer zu empfehlen
Sub BlattSchutz()
' kennwort Makro
' Tastenkombination: Keine
Dim myPwd As String, myPwd2 As String
Dim wks As Worksheet
myPwd = Application.InputBox("Passwort eingeben")
myPwd2 = Application.InputBox("Wiederholung")
If myPwd2 = myPwd Then
For Each wks In ActiveWorkbook.Worksheets
wks.Protect Password:=myPwd, DrawingObjects:=True, _
Contents:=True, Scenarios:=True, AllowFormattingCells:=True, _
AllowFormattingColumns:=True, AllowFormattingRows:=True
Next wks
Else
MsgBox "Passwort falsch"
End If
End Sub

Blattschutz aufheben = UnProtect
Matthias

Hallo
Das Gegenstück von Protect ist UnProtect
Gruß Matthias

Blattschutz aufheben
Werner

Moin, kann mir jeman helfen, habe hier das bei meinem Ecxelprogramm eingefügt, aber bräuchte auch das Gegenstück und bekomme es nicht hin.
Option Explicit ' Immer zu empfehlen
Sub BlattSchutz()
' kennwort Makro
' Tastenkombination: Keine
Dim myPwd As String, myPwd2 As String
Dim wks As Worksheet
myPwd = Application.InputBox("Passwort eingeben")
myPwd2 = Application.InputBox("Wiederholung")
If myPwd2 = myPwd Then
For Each wks In ActiveWorkbook.Worksheets
wks.Protect Password:=myPwd, DrawingObjects:=True, _
Contents:=True, Scenarios:=True, AllowFormattingCells:=True, _
AllowFormattingColumns:=True, AllowFormattingRows:=True
Next wks
Else
MsgBox "Passwort falsch"
End If
End Sub

Blattschutz aufheben = UnProtect
Matthias

Hallo
Das Gegenstück von Protect ist UnProtect
Gruß Matthias

Dialog-Beispiele
Bewerten Sie hier bitte das Excel-Portal