View Single Post
  #5   Report Post  
killme2008 killme2008 is offline
Junior Member
 
Posts: 16
Default

Your worksheet function I'll not modify.
I give you the VBA function to judge if it is a date.
If it is a date, it will return true, otherwise it will return false.
The function DateJudge have 2 parametres
ra is a cell address, iyear is a condition that you can modify when the year =iyear, it can be recognized as a date.

Function DateJudge(ra As Range, iyear As Integer)
DateJudge = False
If IsDate(ra) Then
If Year(ra) = iyear Then DateJudge = True
End If
End Function