Only had a few minutes to play with this as I have to go to work.
The following works for a specific sheet. You could copy it to every sheet if necessary or play with it for the workbook. to make things easier, I use some "hidden and out of the way cells" to hold calculations like this. L2 and L3 would be used to hold the AM and PM counts so the user could see exactly how many they have before making any entries. Or, you could modify the code to calculate the
countif() on the fly. Your choice.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myRange As Range
Set myRange = Intersect(Range("J:J"), Target)
If Not myRange Is Nothing Then
If Range("L2").Value => 20 Then
MsgBox ("You have 20 scheduled")
End If
If Range("L3").Value => 20 Then
MsgBox ("You have 20 scheduled")
End If
End If
End Sub
Cell L2 and L3 have this formula
=COUNTIF(J:J,"AM") and
=COUNTIF(J:J, "FM") respectively
Good luck. I will check back tonight
ttfn
Kicker