View Single Post
  #3   Report Post  
Richard Buttrey
 
Posts: n/a
Default Write once cells

On Sun, 16 Oct 2005 21:16:48 +0000, HuckinD
wrote:


Is there any way that I can write a macro or code for a quiz sheet I
have made.
I want my pupils to be able to type into the cell but would like it
lock the cell after they have typed something in so effectively I can
use it as a test but the first answer is the one that counts.
Somebody suggested that I rightclick on the workbook tab and then use
the view code function, but I know nothing about computer code and
would not know what to write in the boxes
Any ideas would be greatly appreciated.
Thanks
Dave



How foolproof would you want this to be? To set protection you need to
set a password. If you want to have a macro temporarily switch off
protection whilst the user enters a value, I guess you're going to
have to have the password stored in the macro, and anyone who knew how
to find their way around VBA could discover the password. That said
you could sort of hide the password in a complex algorithm rather than
a straightforward piece of text.

If this rudimentary security is acceptable, I think the approach I'd
adopt would be to name all the cells where you want the answers. e.g.
"Ans1", "Ans2" etc. and have the macro store in the comment behind the
cell a flag to show it had been accessed.

The macro would respond to the SheetChange event when an answer cell
is selected, and first test to see if the comment flag has been set.
If not then allow an answer and set the flag.

If this is the sort of thing that you want, post back and I'll try and
suggest some code. How many questions would you want to handle and are
there any other design features required?

Rgds
__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________