Public Function CtrlDate(X As String) As Boolean
Dim D As Date
CtrlDate = True
If Not IsDate(X) Then
CtrlDate = False
Exit Function
End If
D = CDate(X)
If Year(D) < 2009 Or Year(D) > 2012 Then
CtrlDate = False
End If
End Function