Hi,
Hi,
I want to lock a cell Range based on cell value in another ther cell.
For instance , The cell A1 contain a formula with Logical value True/False, and If A1 is True i want to Lock all the Rnage B1:AA1 and dont want to enter any values to this range. I used below code and the cell format protection is getting changed, but when i protect the sheet and change the Value in A1 its getting Error "Unable to set the locked property of the range class"... Can you please help.............
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A1").Value = 10 Then
Range("B1:AA1").Locked = False
Else
Range("B1:AA1").Locked = True
End If
End Sub
Bookmarks