Hello, I have the following code to lock the entire row, if the cell selects Yes, but how can I just lock the row from column a to Cd if cell.value is yes.
I also then want to say if cell.value="No" , unlock the row and if it's "" do nothing to the row.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
For Each cell In Range("CE7:CE357")
If cell.Value = "Yes" Then
ActiveSheet.Unprotect "Password"
cell.EntireRow.Locked = True
ActiveSheet.Protect "Password"
End If
Next cell
End Sub
I also then want to say if cell.value="No" , unlock the row and if it's "" do nothing to the row.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
For Each cell In Range("CE7:CE357")
If cell.Value = "Yes" Then
ActiveSheet.Unprotect "Password"
cell.EntireRow.Locked = True
ActiveSheet.Protect "Password"
End If
Next cell
End Sub