|
Sub 全表普通保护()
On Error Resume Next
Dim i%
For i = 1 To Worksheets.count
With Sheets(i)
.Activate
.Cells.Select
Selection.Cells.Locked = False
Selection.Cells.Locked = True
.protect Password:="111", userinterfaceonly:=True, AllowFiltering:=True, AllowUsingPivotTables:=True
End With
Next i
End Sub
Sub 单表普通保护()
On Error Resume Next
With ActiveSheet
.Activate
.Cells.Select
Selection.Cells.Locked = False
Selection.Cells.Locked = True
.protect Password:="111", userinterfaceonly:=True, AllowFiltering:=True, AllowUsingPivotTables:=True
End With
End Sub |
|