|
-
March 9th, 2009, 05:47 PM
#1
unlock cell based on content from another cell
I am trying to build a report form for my local volunteer fire department.
I need to be able to unlock cells g12 and af12 based on the content of cell e9. I am not a code writer but here is what I have and it is not working.
By the way the whole sheet is protected and only cells needing to be edited are formated to be unlocked. NO PASSWORD
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("E9") = "WF-" Then
Range("G12, AF12").Locked = False
Else: Range("G12,AF12").ClearContents
End If
Am I missing something or do I just have it too simple.
I tried to run this code but I get a "Unable to set the locked property of the Range class" if E9="WF-" Otherwise, -IF e9 does not ="WF-" I come up with and error that says "the cell or chart you are trying to change is protected and therefore read-only." "To modify a protected cell or chart, first remove protection using the unprotect sheet command...)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|