montecarlo2079
Board Regular
- Joined
- Feb 9, 2011
- Messages
- 207
I have a form that calculates a score of an individual.
There is one section that a person can earn a score on one section or the other.
So if there is a score in cell A1, then I should not be allowed to enter anything in cell B1.
And Vice Versa
I found this but it only works one way
This doesnt seem to work.
Any suggestions?
There is one section that a person can earn a score on one section or the other.
So if there is a score in cell A1, then I should not be allowed to enter anything in cell B1.
And Vice Versa
I found this but it only works one way
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If InRange(ActiveCell, Range("A1")) Then
ActiveSheet.Unprotect
ActiveCell.Offset(-1, 0).Locked = True
ActiveSheet.Protect
Else: End If
End Sub
Function InRange(Range1 As Range, Range2 As Range) As Boolean
'returns True if Range1 is within Range2
Dim InterSectRange As Range
Set InterSectRange = Application.Intersect(Range1, Range2)
InRange = Not InterSectRange Is Nothing
Set InterSectRange = Nothing
End Function
This doesnt seem to work.
Any suggestions?