I currently have a macro that unlocks a range of cells depending on the numeric value of an input cell. It looks like this:
[c4:c19].Locked = True
If [b2] > 15 Then
[c4:c19].Locked = False
ElseIf [b2] > 14 Then
[c4:c18].Locked = False
ElseIf [b2] > 13 Then
[c4:c17].Locked = False
ElseIf [b2] > 12 Then
[c4:c16].Locked = False
ElseIf [b2] > 11 Then
As you can see, this is unwieldy. If I want to expand the range of cells, then the number of ElseIf statements becomes unwieldy.
Is there a way to insert the cell value in the logic, such as:
[c4:"value in cell b2")].Locked = False
where the second parameter would be the numeric value of cell b2?
[c4:c19].Locked = True
If [b2] > 15 Then
[c4:c19].Locked = False
ElseIf [b2] > 14 Then
[c4:c18].Locked = False
ElseIf [b2] > 13 Then
[c4:c17].Locked = False
ElseIf [b2] > 12 Then
[c4:c16].Locked = False
ElseIf [b2] > 11 Then
As you can see, this is unwieldy. If I want to expand the range of cells, then the number of ElseIf statements becomes unwieldy.
Is there a way to insert the cell value in the logic, such as:
[c4:"value in cell b2")].Locked = False
where the second parameter would be the numeric value of cell b2?