Hello!
The macro I have been using to auto lock cells after they have had anything written into them works great! However...
Merged cells.... It can't handle merged cells.
Any idea's on how to improve the code to make it also lock cells?
This is the code I have been using
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cel As Range
ActiveSheet.Unprotect ' Password:="secret"
For Each cel In Target
If cel.Value <> "" Then
cel.Locked = True
End If
Next cel
ActiveSheet.Protect ' Password:="secret"
End Sub
Thanks in advance!
The macro I have been using to auto lock cells after they have had anything written into them works great! However...
Merged cells.... It can't handle merged cells.
Any idea's on how to improve the code to make it also lock cells?
This is the code I have been using
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cel As Range
ActiveSheet.Unprotect ' Password:="secret"
For Each cel In Target
If cel.Value <> "" Then
cel.Locked = True
End If
Next cel
ActiveSheet.Protect ' Password:="secret"
End Sub
Thanks in advance!