Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
cell locking problem
Hi,
I have a sheet, in which i have to lock a single cell. i used the following code: ActiveSheet.Range("$J$29:$K$29").Select Range("$J$29:$K$29").Select ActiveSheet.Unprotect Selection.Locked = True Range("$J$29:$K$29").Select ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _ False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _ AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _ :=True, AllowInsertingHyperlinks:=True, AllowDeletingColumns:=True, _ AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _ AllowUsingPivotTables:=True ActiveSheet.EnableSelection = xlUnlockedCells above code locks the cell perfectly, but it also locks some of the cell below the locked cell ($J$29). Please help. thanks, navin |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
cell locking problem
navin,
With Activesheet .Unprotect .Range("J29").Locked = True .Protect DrawingObjects:=False, Contents:=True, Scenarios:= _ False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _ AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _ :=True, AllowInsertingHyperlinks:=True, AllowDeletingColumns:=True, _ AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _ AllowUsingPivotTables:=True End With hth, Doug "navin" wrote in message ps.com... Hi, I have a sheet, in which i have to lock a single cell. i used the following code: ActiveSheet.Range("$J$29:$K$29").Select Range("$J$29:$K$29").Select ActiveSheet.Unprotect Selection.Locked = True Range("$J$29:$K$29").Select ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _ False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _ AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _ :=True, AllowInsertingHyperlinks:=True, AllowDeletingColumns:=True, _ AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _ AllowUsingPivotTables:=True ActiveSheet.EnableSelection = xlUnlockedCells above code locks the cell perfectly, but it also locks some of the cell below the locked cell ($J$29). Please help. thanks, navin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel file keeps locking - Strange problem | Excel Discussion (Misc queries) | |||
Locking Cell | Excel Worksheet Functions | |||
Locking cell | Excel Discussion (Misc queries) | |||
locking only one cell | Excel Discussion (Misc queries) | |||
locking formula in cells in without locking whole sheet | Excel Discussion (Misc queries) |