Sub protect_formulas()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
On Error ResumeNext
Dim sht AsWorksheet
For Each sht InThisWorkbook.Sheets
sht.Select
With Cells '解除所有单元格的锁定和隐藏
.Locked =False
.FormulaHidden = False
End With
With Cells.SpecialCells(xlCellTypeFormulas) '对所有使用公式的单元格进行锁定和隐藏
.Locked =True
.FormulaHidden = True
End With
sht.Protect
Next
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。