I've traced the following code in debug a couple of times in disbelief. The function receives the string "3/6". With the split, UBound(Ar) is 1; Ar(0) = 3; Ar(1) = 6. The LastDay function receives Ar(0), which is 3, and returns 31, the last day of month March. Given those values, the function VDate should return 0, since 6 <= 31.
Code:Private Function VDate(strMD As String) As Integer Dim LDOM As String Ar = Split(strMD, "/") LDOM = LastDay(Ar(0)) VDate = 1 If UBound(Ar) = 1 Then If Ar(0) >= 1 And Ar(0) <= 12 Then If Ar(1) >= 1 Then If Ar(1) <= LDOM Then VDate = 0 End If End If End If End Function