I am using a spreadsheet as a form which many persons may have to sign. The worksheet that would be used for signatures is locked, and must be unlocked when the signature cell is entered. Some signature cells are fixed in their location, others will be created by the form itself. The code for unlocking is:
What I need to figure out, is how to unlock the cells that will be created by the form. The cells will start in range F20, and be repeated every 4 rows (e.g. F24, F28, F32 etc.). I was thinking that maybe I can use the MOD function to identify the other cells to unlock. I'm not sure how to do it though. Any ideas on this, or other suggestions are welcome. Thanks in advance.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim KeyCells As Range
Set KeyCells = Union(Range("E13"), Range("E14"), Range("F20"))
If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
Sheets("Data").Unprotect Password:="Checklist"
Else: Sheets("Data").Protect Password:="Checklist"
End If
End Sub
What I need to figure out, is how to unlock the cells that will be created by the form. The cells will start in range F20, and be repeated every 4 rows (e.g. F24, F28, F32 etc.). I was thinking that maybe I can use the MOD function to identify the other cells to unlock. I'm not sure how to do it though. Any ideas on this, or other suggestions are welcome. Thanks in advance.