Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all
My code reads one cell and through the options it locks or not others cells. Im trying to extend my programming to all subsequent cells. How can I do it? Like using "for" instruction?!?! Does anybody help me? Private Sub Worksheet_Change(ByVal Target As Range) If [E9]= "A" Then ActiveSheet.Unprotect ("") ActiveSheet.Range("G9:K9").Locked = True ActiveSheet.Range("F9").Locked = False [G9:K9].Interior.ColorIndex = 15 [F9].Interior.ColorIndex = 0 ActiveSheet.Protect ("") ElseIf Target.Cells.Text = "B" Then ActiveSheet.Unprotect ("") ActiveSheet.Range("G9:K9").Locked = False ActiveSheet.Range("F9").Locked = True [G9:K9].Interior.ColorIndex = 0 [F9].Interior.ColorIndex = 15 ActiveSheet.Protect ("") Else ActiveSheet.Unprotect ("") ActiveSheet.Range("F9:K9").Locked = True [F9:K9].Interior.ColorIndex = 15 ActiveSheet.Protect ("") End If End Sub Thanks in advance Kelson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Check if cells contain the word "Thailand", return "TRUE" | Excel Worksheet Functions | |||
Do mighty exchange "pixels" on "mm" - cells (width, height)? :( | Excel Programming | |||
Can you "duplicate" "copy" listboxes and code to multiple cells? | Excel Programming | |||
Using "Cells" to write "Range("A:A,H:H").Select" | Excel Programming |