Re: Unlock a cell acording to another cell
It's me again.
I have done what Doc wrote to me. And it's working perfect. I thoght it then was plug and play to do it with the next cells. But it's not. Now i have this code here:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range
Set A = Application.Intersect(Target, Range("C3"))
If A Is Nothing Then Exit Sub
ActiveSheet.Unprotect
Range("C4").Select
Selection.Locked = False
Selection.FormulaHidden = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Dim B As Range
Set B = Application.Intersect(Target, Range("C4"))
If B Is Nothing Then Exit Sub
ActiveSheet.Unprotect
Range("C5").Select
Selection.Locked = False
Selection.FormulaHidden = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Dim C As Range
Set C = Application.Intersect(Target, Range("C5"))
If C Is Nothing Then Exit Sub
ActiveSheet.Unprotect
Range("C6").Select
Selection.Locked = False
Selection.FormulaHidden = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
Display More
It will only onlock cell C4. When I then try to wite in Cell C5 then Excel tells me that the cell is protected.
What am I doing wrong??
Alring