You can make two buttons and link them to something like the code below. Determine the formatting of the locked cells (i find that grey fill with white font is sugestive).
Ex.1
Ex.2
Sub Unprotect()
With Sheets("Sheet2")
.Shapes("Edit").Visible = False
.Shapes("Rounded Rectangle 2").Visible = True
.Unprotect
.Cells.ClearFormats
End With
End Sub
Sub Protect()
Sheets("Sheet2").Select
ActiveSheet.Shapes("Rounded Rectangle 2").Visible = False
ActiveSheet.Shapes("Edit").Visible = True
With Sheets("Sheet2").Cells
.Interior.Pattern = xlSolid
.Interior.PatternColorIndex = xlAutomatic
.Interior.ThemeColor = xlThemeColorDark1
.Interior.TintAndShade = -0.149998474074526
.Interior.PatternTintAndShade = 0
.Font.ThemeColor = xlThemeColorDark1
.Font.TintAndShade = 0
End With
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…