S
stamateandreiv
Hello,
In an sheet I need that after a date is reached, some cells to be
protected from writing.
For example: today is 11.03,2009 and after 31.03.2009 some cells
(example A1:G1, A2:G2 etc) from the sheet will be protected for
writing.
I have the following code, but you can unprotect the cells from the
review tab - so this doesnt help me at all:
Private Sub Worksheet_Change(ByVal Target As Range)
Range("D6").FormulaR1C1 = "=TODAY()"
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
final_date = Cells(4, 4).Value
current_date = Cells(6, 4).Value
If current_date > final_date Then ActiveSheet.Protect
DrawingObjects:=True, Contents:=True, Scenarios:=True
If current_date <= final_date Then ActiveSheet.Unprotect
End Sub
can you please advise me in this issue? How to protect the cells with
a psswd?
Thank you,
Andrei
In an sheet I need that after a date is reached, some cells to be
protected from writing.
For example: today is 11.03,2009 and after 31.03.2009 some cells
(example A1:G1, A2:G2 etc) from the sheet will be protected for
writing.
I have the following code, but you can unprotect the cells from the
review tab - so this doesnt help me at all:
Private Sub Worksheet_Change(ByVal Target As Range)
Range("D6").FormulaR1C1 = "=TODAY()"
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
final_date = Cells(4, 4).Value
current_date = Cells(6, 4).Value
If current_date > final_date Then ActiveSheet.Protect
DrawingObjects:=True, Contents:=True, Scenarios:=True
If current_date <= final_date Then ActiveSheet.Unprotect
End Sub
can you please advise me in this issue? How to protect the cells with
a psswd?
Thank you,
Andrei