I am setting up a spreadsheet to trend data for analytical testing of chemical products. I would like for each line of data to be locked once the transcription of said data has been verified by the reviewer. I am able to lock a single line using this code in VBA:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("X3") = "No" Then
Range("B3:W3").Locked = False
ElseIf Range("X3") = "Yes" Then
Range("B3:W3").Locked = True
End If
End Sub
Column X contains a dropdown list with "Yes" and "No" as the two options. I would like for each line of data, as it is added to the sheet, to be locked once the reviewer has selected yes in this column to make sure no unintended changes are made to past data. Is this possible without having to repeat the about code for each line indefinitely?
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("X3") = "No" Then
Range("B3:W3").Locked = False
ElseIf Range("X3") = "Yes" Then
Range("B3:W3").Locked = True
End If
End Sub
Column X contains a dropdown list with "Yes" and "No" as the two options. I would like for each line of data, as it is added to the sheet, to be locked once the reviewer has selected yes in this column to make sure no unintended changes are made to past data. Is this possible without having to repeat the about code for each line indefinitely?
- Page :
- 1
There are no replies made for this post yet.