Private Sub workbook_Open()
For Each sht In Worksheets
sht.Protect Password:="123456", userinterfaceonly:=True
sht.EnableOutlining = True '保护工作表,并将密码设置为指定内容,可修改此处更换密码
Next
End Sub
相关文章
- 03-09EXCEL-解决表格被锁定和分组的冲突
2024-03-09 13:45:41
Private Sub workbook_Open()
For Each sht In Worksheets
sht.Protect Password:="123456", userinterfaceonly:=True
sht.EnableOutlining = True '保护工作表,并将密码设置为指定内容,可修改此处更换密码
Next
End Sub