#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 201
Default Locking Cells

I have a spreadsheet where a person will enter a days data, A1:A58 and their
name in the next cell A59.

A second person will check the data and then enter their name in the next
cell A60.
(Cell A60 is password protected).

I would like entry of text into the specific cell (A60) to lock all others
above (A1:A59) in that column.

Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Locking Cells

Phil

Assuming A1:A59 are unlocked and sheet is protected with a password of "justme"

User enters data in A1:A58 then enters name in A59.

Checker unprotects the sheet using password and enters name in A60.

The code below will re-protect the sheet with A1:A59 locked.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A60")) Is Nothing Then

With Target
If .Value < "" Then
Range("A1:A59").Cells.Locked = True
End If
End With
End If

enditall:
Application.EnableEvents = True
ActiveSheet.protect Password:="justme"
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code"

Copy/paste the code into that sheet module.


Gord Dibben MS Excel MVP

On Wed, 6 Dec 2006 04:35:01 -0800, Phil wrote:

I have a spreadsheet where a person will enter a days data, A1:A58 and their
name in the next cell A59.

A second person will check the data and then enter their name in the next
cell A60.
(Cell A60 is password protected).

I would like entry of text into the specific cell (A60) to lock all others
above (A1:A59) in that column.

Is this possible?


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
Linking Groups of cells between workbooks vnacj-joe Excel Discussion (Misc queries) 4 June 14th 07 06:18 PM
Locking all cells accross when sorting columns David New Users to Excel 2 September 9th 06 10:26 PM
locking formula in cells in without locking whole sheet SuziQ Excel Discussion (Misc queries) 1 July 21st 06 04:58 PM
Locking linked cells satkinson Excel Worksheet Functions 0 November 3rd 05 06:28 PM
Locking certain cells Marvin Excel Worksheet Functions 1 December 7th 04 08:13 PM


All times are GMT +1. The time now is 07:58 AM.

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

About Us

"It's about Microsoft Excel"