with the help search engine and a miniscule copy/paste job I was able to assemble the following code which is locking cells
in a range after data has been entered:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B3:AI28,D29:D33,AM3:AM4")) Is Nothing Then
If Target.Locked = False Then
Target.Locked = True
If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
Now, rows B3:B28 contain a date of employees arrival at work.
What I would like to accomplish next is that
even when some cells in range are blank, user without password won't be able to fill them after Date+1 time had passed (they
will become locked).
Moreover, in my particular circumstances, another way to accomplish it might be by using the
file name, as for every day in a month I create a table with corresponding number. Right now it structured by way of folders
and subfolders and the worksheet name contains only day number of the month (e.g. ..2012417.xlsm), but it can be very well be
changed (for example into ..2012-04-17.xlsm).
Solution by means of file name might even be preferable, as it would
prevent to change retroactively data on days when no employee attended (meaning no date in B3:B28 rows).
Is it as
easy as a piece of cake for seasoned Ozgrids? :-)
If it is the case, you have my many thanks in advance!