manchmal funktioniert das folgende Makro, manchmal nicht. Ich weiß leider nicht, woran das liegt. Ich will halt eine Formatierung zulassen, wenn schutz auf dem sheet liegt:
Sub Workbook_Open()
Dim i As Long
For i = 1 To Sheets.Count
Sheets(i).Protect Password:="...", UserInterfaceOnly:=True, AllowFormattingRows:=True, _
AllowFormattingColumns:=True, AllowFormattingCells:=True, DrawingObjects:=False, AllowInsertingRows:=True, AllowDeletingRows:=True, Contents:=True
Sheets(i).EnableOutlining = True 'für Gliederung
Sheets(i).EnableAutoFilter = True 'für Autofilter
Next i
End Sub
Was stimmt hier nicht, hilft jemand?