Public Function IsLeapYear(ByRef d As Variant) As Boolean
Select Case VarType(d)
Case vbDate: Dim f&: f = Year(d): IsLeapYear = ((f Mod 4 = 0) And (f Mod 100)) Or (f Mod 400 = 0)
Case vbLong, vbInteger, vbByte: IsLeapYear = ((d Mod 4 = 0) And (d Mod 100)) Or (d Mod 400 = 0)
End Select
End Function