シートの保護 対象のシート.Protect シート保護の解除 対象のシート.Unprotect
Sub ProtectSample_01() Dim sheetXXX As Worksheet Set sheetXXX = Worksheets("Sheet1") sheetXXX.Protect End Sub
Sub ProtectSample_02() Dim sheetXXX As Worksheet Set sheetXXX = Worksheets("Sheet1") sheetXXX.Unprotect End Sub
Sub ProtectSample_03() Dim sheetXXX As Worksheet Set sheetXXX = Worksheets("Sheet1") sheetXXX.Protect Password:="Password" End Sub
Sub ProtectSample_04() Dim sheetXXX As Worksheet Set sheetXXX = Worksheets("Sheet1") sheetXXX.Unprotect Password:="Password" End Sub