Sub test()
Dim vUnlocked As Variant
Dim rngUnlocked As Range
With ActiveSheet
.Unprotect Password:="abcd" '<<<<这好象要加入解保护??
If .ProtectContents = True Then .Unprotect
vUnlocked = .UsedRange
.UsedRange.ClearContents
.Protect
On Error Resume Next
.UsedRange.Value = 1
.Unprotect
Set rngUnlocked = .UsedRange.SpecialCells(xlCellTypeConstants)
.UsedRange = vUnlocked
rngUnlocked.Select
.Protect Password:="abcd" '<<<< 这好象要加入加保护???
End With
Selection.ClearContents
End Sub