Hi,
I need to lock the sheet automatically once the date is passed. I have attached the sample sheet.
Please give your input and guide me about this.
Last edited by anwitha; 12-11-2011 at 12:57 AM.
Hi anwitha
You can do this, using Validation(Data>Validation>Custom)
You can not use NOW() function,in B2,
because in this case, the result(a2-b2), changes every second!!
The formula that you have to use in Validation(marking all the Sheet) is:
=SUM($A$2-$B$2)<2)
Hope to helps you.
Regards
Regards
Fotis.
I am proud that i am Greek.
Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?
Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.
Please,mark your thread [SOLVED] if you received your answer.
My Avadar picture, is from Athens Acropolis.
http://www.theacropolismuseum.gr
http://www.visitgreece.gr/
Hi Fotis
Thanks for your reply but I want when that date is crossed after 2 days entire sheet should get locked...any idea how to do that?
Regards,
Anwitha
hi Anwitha,
as an option try this one and see if it helps you
Private Sub Workbook_Open() If [b2] - [a2] >= 2 Then Sheets(1).Protect "123" End Sub
Regards, John
Hi Joh,
Thanks for your help. but I have given specified cell access to all the users I want that given specified cell should lock once the date is passed 2 days. The code which you have provided is not working in this scenario. Is there any other option availabe to do that?
hi,
add the code in the workbook_open event, if the date in cell a2 is < or = with 2 days than the date in cell b2 when you open the file the sheet is protected.
the password is 123. go to main meniu, Review, Unprotect Sheet, password 123.
see the file attached.
hope it helps you
Last edited by john55; 12-10-2011 at 02:31 AM.
Regards, John
Hi John,
Please refer to the newly attached sheet. I have given the access to the users to update only for the column F apart from that they are not able to edit any other cells. My concern is if the date in A2 cell is more than 2 days to B2 Cell then that F column also should get locked.
Attached the sample sheet for your reference.
Thanks.
Sambashiva
I am sorry, perhaps someone else has another approach.
Last edited by john55; 12-10-2011 at 03:56 AM.
Regards, John
maybe so
Sub Button2_Click() With Sheets(1) .Unprotect "123" .Columns("F:F").Locked = .[b2] - .[a2] > 2 .Protect "123" End With End Sub
Hi nilem.
Its working fine Thanks for your help.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks