Locking cells

G

Guest

Is it possible to lock the cells with conditio. I want to lock all the cells
after one week from the certain date on the sheet.

for Ex. $A$23 cell have the date 15 Aug 2005 and i want to lock the cell
$C$8 to $H$23 after one week from that date. so that no one can change the
data.

Thanks in advance
 
D

Don Guillett

By default all cells are locked. You would need to unlock all desired and
then have a macro to lock the desired cells.
Sub lockcells()
Range("b1:d12").Locked = False
If Date > Range("a4") + 15 Then Range("b1:b4").Locked = True
End Sub
 
G

Guest

Hi
Using Data/Validation menu, select the cells to be locked and choose in the
validation dialog box Allow: Custom with the following formula:
=TODAY()<=$A$23+7
and don't select Ignore blank.
As long as you're not a week after the date in A23, the user can enter what
he or she wants but after this date, the selected cells are not anymore
modifiable.
uh... Am I clear enough? I wonder... anyway, don't hesitate to ask more
details...
 

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

Top