good day
I would like to ask to to protect my sheet
I have tried to put ActiveSheet.protect ("1") but unfortunately, im getting a popup message ( the cell or chart you're trying to change is a protected sheet. To make a change unprotect the sheet. You might be requested to enter a password.)
thank you.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Result, Test As Range
Set Result = Range("N5")
ActiveSheet.Unprotect ("1")
Select Case Result
Case Is = "Reagent & Ortho Cards File": Rows("12:100").EntireRow.Hidden = True
Rows("7:11").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "Validation File": Rows("7:11").EntireRow.Hidden = True
Rows("18:100").EntireRow.Hidden = True
Rows("12:17").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "Antibody Workup & Transfusion Reaction Database": Rows("7:17").EntireRow.Hidden = True
Rows("24:100").EntireRow.Hidden = True
Rows("18:23").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "QC Files": Rows("7:23").EntireRow.Hidden = True
Rows("29:100").EntireRow.Hidden = True
Rows("24:28").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "Received Blood Components": Rows("7:29").EntireRow.Hidden = True
Rows("35:100").EntireRow.Hidden = True
Rows("30:34").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "Equipment Calibration File": Rows("7:35").EntireRow.Hidden = True
Rows("48:100").EntireRow.Hidden = True
Rows("36:47").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "COMARK File": Rows("7:48").EntireRow.Hidden = True
Rows("54:100").EntireRow.Hidden = True
Rows("49:53").EntireRow.Hidden = False
Case Is = "CAP Inspection File": Rows("7:54").EntireRow.Hidden = True
Rows("60:100").EntireRow.Hidden = True
Rows("55:59").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "BB Soft Copy Files": Rows("7:60").EntireRow.Hidden = True
Rows("71:100").EntireRow.Hidden = True
Rows("61:70").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "KPI Files": Rows("7:71").EntireRow.Hidden = True
Rows("75:100").EntireRow.Hidden = True
Rows("72:74").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "Temperatuer Files": Rows("7:75").EntireRow.Hidden = True
Rows("80:100").EntireRow.Hidden = True
Rows("76:79").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "Administrative Files": Rows("7:80").EntireRow.Hidden = True
Rows("88:100").EntireRow.Hidden = True
Rows("81:87").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
End Select
End Sub
I would like to ask to to protect my sheet
I have tried to put ActiveSheet.protect ("1") but unfortunately, im getting a popup message ( the cell or chart you're trying to change is a protected sheet. To make a change unprotect the sheet. You might be requested to enter a password.)
thank you.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Result, Test As Range
Set Result = Range("N5")
ActiveSheet.Unprotect ("1")
Select Case Result
Case Is = "Reagent & Ortho Cards File": Rows("12:100").EntireRow.Hidden = True
Rows("7:11").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "Validation File": Rows("7:11").EntireRow.Hidden = True
Rows("18:100").EntireRow.Hidden = True
Rows("12:17").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "Antibody Workup & Transfusion Reaction Database": Rows("7:17").EntireRow.Hidden = True
Rows("24:100").EntireRow.Hidden = True
Rows("18:23").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "QC Files": Rows("7:23").EntireRow.Hidden = True
Rows("29:100").EntireRow.Hidden = True
Rows("24:28").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "Received Blood Components": Rows("7:29").EntireRow.Hidden = True
Rows("35:100").EntireRow.Hidden = True
Rows("30:34").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "Equipment Calibration File": Rows("7:35").EntireRow.Hidden = True
Rows("48:100").EntireRow.Hidden = True
Rows("36:47").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "COMARK File": Rows("7:48").EntireRow.Hidden = True
Rows("54:100").EntireRow.Hidden = True
Rows("49:53").EntireRow.Hidden = False
Case Is = "CAP Inspection File": Rows("7:54").EntireRow.Hidden = True
Rows("60:100").EntireRow.Hidden = True
Rows("55:59").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "BB Soft Copy Files": Rows("7:60").EntireRow.Hidden = True
Rows("71:100").EntireRow.Hidden = True
Rows("61:70").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "KPI Files": Rows("7:71").EntireRow.Hidden = True
Rows("75:100").EntireRow.Hidden = True
Rows("72:74").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "Temperatuer Files": Rows("7:75").EntireRow.Hidden = True
Rows("80:100").EntireRow.Hidden = True
Rows("76:79").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
Case Is = "Administrative Files": Rows("7:80").EntireRow.Hidden = True
Rows("88:100").EntireRow.Hidden = True
Rows("81:87").EntireRow.Hidden = False
ActiveSheet.Protect ("1")
End Select
End Sub