Forum Discussion
VinScho
Jan 22, 2022Copper Contributor
Adding a further level of restriction to date record user input password protected cells
Hello, I have an issue where I have ranges of password protected cells on a locked sheet (input by various users with individual passwords). The users input a date in each cell to confirm comple...
bosinander
Jan 22, 2022Iron Contributor
VinScho Hi,
You will have to use a macro and this may be a step on the way.
I have unlocked cells formatted as Home: Cell Styles: Input.
Sub protectAfterLimit()
Dim cell As Range
ActiveSheet.Unprotect ("prettylongpassword")
For Each cell In ActiveSheet.UsedRange.Cells
If cell.Locked = False Then
' cell.Select
If cell.Value = "" Then
ElseIf cell.Value <= Now() - Range("limit_days").Value Then
cell.Locked = True
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
End If
Next cell
ActiveSheet.Protect "prettylongpassword", DrawingObjects:=True, Contents:=True, Scenarios:=True
End SubThe attached file is saved without protection.