Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locked cells
How do I lock/unlock cells in code?
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locked cells
Hi Amy
Selection.Locked = True Selection.Locked = False Or Range("A1:c10").Locked = True Or all cells on the worksheet Cells.Locked = True -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Amy" wrote in message ... How do I lock/unlock cells in code? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locked cells
okay this is what I have:
Private Sub Workbook_Open() 'check for filter, turn on if none exists With Worksheets("worksheet") If Not .AutoFilterMode Then .Range("A2").AutoFilter End If .EnableAutoFilter = True .Protect Password:="password", _ Contents:=True, UserInterfaceOnly:=True Range("C:C,D:D,L:L").Selec Selection.Locked = True End With End Sub it doesn't lock the cells.... any ideas? -----Original Message----- Hi Amy Selection.Locked = True Selection.Locked = False Or Range("A1:c10").Locked = True Or all cells on the worksheet Cells.Locked = True -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Amy" wrote in message ... How do I lock/unlock cells in code? . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locked cells
Change the locked before you protect the sheet
Try this Private Sub Workbook_Open() 'check for filter, turn on if none exists With Worksheets("worksheet") If Not .AutoFilterMode Then .Range("A2").AutoFilter End If .Range("C:C,D:D,L:L").Locked = True .EnableAutoFilter = True .Protect Password:="password", _ Contents:=True, UserInterfaceOnly:=True End With End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Amy" wrote in message ... okay this is what I have: Private Sub Workbook_Open() 'check for filter, turn on if none exists With Worksheets("worksheet") If Not .AutoFilterMode Then .Range("A2").AutoFilter End If .EnableAutoFilter = True .Protect Password:="password", _ Contents:=True, UserInterfaceOnly:=True Range("C:C,D:D,L:L").Selec Selection.Locked = True End With End Sub it doesn't lock the cells.... any ideas? -----Original Message----- Hi Amy Selection.Locked = True Selection.Locked = False Or Range("A1:c10").Locked = True Or all cells on the worksheet Cells.Locked = True -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Amy" wrote in message ... How do I lock/unlock cells in code? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Locked Cells | Excel Discussion (Misc queries) | |||
Locked worksheet & hyperlinks (w/ select locked cells unchecked) | Excel Discussion (Misc queries) | |||
Locked Cells | Excel Worksheet Functions | |||
paste locked cells and unlocked cells in protected sheet | Excel Worksheet Functions | |||
Put comments on a locked spreadsheet even though cells not locked | Excel Worksheet Functions |