View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
navin navin is offline
external usenet poster
 
Posts: 32
Default 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