Private Sub Worksheet_Change(ByVal Target As Range)
Dim myRange As Range
Dim isect As Range
Dim cell As Range
' Specify range to apply this to:
Set myRange = Range("J:J")
Set isect = Intersect(Target, myRange)
' If update not in specified range, exit
If isect Is Nothing Then Exit Sub
Application.EnableEvents = False
' Loop through all cells in intersection
For Each cell In isect
' Check to see if date
If IsDate(cell) Then
If cell < DateSerial(2000, 1, 1) Or cell > DateSerial(2020, 1, 1) Then
cell.ClearContents
MsgBox "Date must be between 1/1/2000 and 1/1/2020", vbOKOnly, "DATE ENTRY ERROR"
End If
Else
' Handle text entries
If (cell <> "N/A") And (cell <> "Done") Then
cell.ClearContents
MsgBox "N/A and Done are the only allowable text entries", vbOKOnly, "TEXT ENTRY ERROR"
End If
End If
Next cell
Application.EnableEvents = True
End Sub