Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel file keeps locking - Strange problem Mick34 Excel Discussion (Misc queries) 0 July 15th 09 03:04 PM
Locking Cell Ridhi Excel Worksheet Functions 1 June 6th 08 02:12 PM
Locking cell whatzzup Excel Discussion (Misc queries) 2 November 1st 07 08:16 PM
locking only one cell AJB Excel Discussion (Misc queries) 2 August 17th 07 09:40 AM
locking formula in cells in without locking whole sheet SuziQ Excel Discussion (Misc queries) 1 July 21st 06 03:58 PM


All times are GMT +1. The time now is 05:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"