Hi Bill
You will need VBA for this.
Right click on the sheet name tab and paste in this code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Me.Range("B4") = "PhoneRental" Then
Me.Unprotect Password:="secret"
Me.Range("A1").Locked = False
Me.Protect Password:="secret"
End If
End Sub
Changes ranges to suit. Push Alt+Q and save.
Dave
OzGrid Business Applications
Hi Dave,
Thanks for your quick response and of course for the answer. I don't need to tell you that your solution works just fine. Even with my limited knowledge I can just about follow what's going on. However could you explain what is the significance of Me at the beginning of each line?
Thanks again.
Bill
Sure Bill, The "Me" is a generic keyword that can be used in VBA and will always refer to the Object that houses the Module it is used in. So, as this code resides in the Worksheet module it will refer to the Worksheet itself. If I used "Me" in the Workbook module it would refer to the Workbook itself. You could also use it in a UserForms Module to refer to the UserForm.
The big advantage of using "Me" is that if the Worksheet, Workbook or UserForm name changes it doesn't matter.
Dave
OzGrid Business Applications
Thanks for taking the time Dave you've been a real help.
Bill