Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
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 | |||
Check if cells contain the word "Thailand", return "TRUE" | Excel Worksheet Functions | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
cells formatted to tick when text value "Y" if or null if "N" | Excel Discussion (Misc queries) |