Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old February 28th 06, 07:55 PM posted to microsoft.public.excel.misc
Ripper
 
Posts: n/a
Default Lock Cell After Data Entry

Is there a way to lock a cell from edit or delete after a person has entered
data into it?

I am using Excel as a survey tool in a class. Each student will create a
survey and then the students will rotate around the lab and take each
student's survey. I don't want a student messing with the former student's
data by changing the answer. Therefore I need to lock or hide the answer
after the student entered it.
--
Thanks As Always
Rip

  #2   Report Post  
Old February 28th 06, 08:17 PM posted to microsoft.public.excel.misc
Paul B
 
Posts: n/a
Default Lock Cell After Data Entry

Ripper, you could some code in the sheet module, right click on the sheet
tab view code like this,

Private Sub Worksheet_Change(ByVal Target As Range)

'Automatically Protecting After Input

'unlock all cells in the range first
Dim MyRange As Range

Const Password = "123" '**Change password here**

Set MyRange = Intersect(Range("A1:B10,C5"), Target) '**change range
here**

If Not MyRange Is Nothing Then

Unprotect Password:=Password

MyRange.Locked = True

Protect Password:=Password

End If

End Sub
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"Ripper" wrote in message
...
Is there a way to lock a cell from edit or delete after a person has
entered
data into it?

I am using Excel as a survey tool in a class. Each student will create a
survey and then the students will rotate around the lab and take each
student's survey. I don't want a student messing with the former
student's
data by changing the answer. Therefore I need to lock or hide the answer
after the student entered it.
--
Thanks As Always
Rip





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
Cell data format falloutx Excel Discussion (Misc queries) 1 February 10th 06 01:46 PM
Blocking entry of data in a cell Rob Excel Worksheet Functions 1 February 5th 06 03:37 PM
data in cell not corresponding with entry Graeme New Users to Excel 1 December 21st 05 04:16 PM
Excel Macro to Copy & Paste [email protected] Excel Worksheet Functions 0 December 1st 05 01:56 PM
Vlookup for data contained in a cell Garbunkel Excel Worksheet Functions 5 September 14th 05 06:47 PM


All times are GMT +1. The time now is 01:15 AM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017