If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Cell lock
Is it possible to change the characteristics of a cell based on content of
another cell. My problem is: If c2=0 then e10 should be locked if c2=1 then e10 should be unlocked. I have conditional formatting on this cell e10 which is depending on the content of c2, ie. e10 = no fill = locked e10 = yellow fill = unlocked. If possible I would like to use the latter as condition. Thanks |
#2
|
|||
|
|||
Hi Adam,
here's the code: Private Sub Worksheet_Change(ByVal Target As Range) If Range("C2").Value = 0 Then ActiveSheet.Unprotect Range("E10").Locked = True Range("E10").Interior.ColorIndex = xlNone ActiveSheet.Protect End If If Range("C2").Value = 1 Then ActiveSheet.Unprotect Range("E10").Locked = False Range("E10").Interior.ColorIndex = 6 ActiveSheet.Protect End If End Sub Obviously, cell C2 is unprotected. you might also want to add some passwords to the Protect/Unprotect code. HTH Fadi www.chalouhis.com/XLBLOG |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I lock an image into a cell and be able to sort? | Ellen | General Discussion | 3 | October 19th, 2004 08:44 PM |
IF E3 & E10 = TRUE set this cell to "Yes", else set to "No" | Timothy L | Worksheet Functions | 5 | August 27th, 2004 02:28 AM |
Newbie - Insert picture and lock to cell | Chris Harden | Charts and Charting | 2 | January 16th, 2004 04:11 PM |
using cell contents in pathname | Don Guillett | Worksheet Functions | 7 | January 2nd, 2004 02:11 PM |
How to lock one cell in formula? | Worksheet Functions | 2 | December 26th, 2003 01:22 PM |