How can I prevent cells from being changed by users

  • Thread starter Thread starter trev
  • Start date Start date
T

trev

I am writing a spreadsheet which requries users to enter a numbe
value.
i want to set the spreadsheet up so to allow an entry tp be made o
altered on or before todays date - but prevent any entries o
alterations after todays date - in other words - protect past entrie
from being changed

How do i do this.
i know i can locked cells so that when a sheet is protected - the cel
cannot be changed, but i want to do this by formular or macro - an
help much appreciated

Trevo
 
Trevor, not exactly what you asked for but this might help, once the data
has been put in the cell you can not change it, put in sheet code

Private Sub Worksheet_Change(ByVal Target As Range)
'Automatically Protecting After Input
'unlock all cells in the range first

Dim MyRange As Range
Set MyRange = Intersect(Range("A1:D100"), Target)
If Not MyRange Is Nothing Then
Unprotect password:="123"
MyRange.Locked = True
Protect password:="123"
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 2000 & 97
** remove news from my email address to reply by email **
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top