Disallowing Triplicates
Oct 13, 2007I'm a teacher and I'm trying to set up a monitoring system for students leaving and reentering the class. Some of them need very close monitoring and restricted privileges.
I've managed to get everything I need working except restricting the amounts of time they can leave. I've been experimenting with Validation lists but running into snags. The VBA code below seemed promising:
Private Sub Worksheet_Change(ByVal Target As Range)
With WorksheetFunction
If .CountIf(Range("C1:C" & Target.Row), Target.Value) > 1 And Target.Column = 3 Then
MsgBox "You Have Already Left XXX Times"
Target.Value = ""
End If
End With
End Sub.......