Signature (Visual Basic / VBA)
Public Function IsLeapYear( _
ByVal vDate As Variant _
) As Variant
Code Example
IsLeapYear(1996) = True
IsLeapYear(#2/5/1996#) = True
IsLeapYear(2000) = True
IsLeapYear(2001) = False
IsLeapYear(#2/5/2001#) = False
Parameters
| Parameter | Description |
|---|---|
| vDate | The date or year number which is checked to see if it is a "leap year." Function examines the year component of the date if vDate is a date value. Function interprets numeric values as years instead of interpreting them as a date. Function returns Null if vDate is Null or cannot be fixed up to either a date or a number. |
Notes & Version History
| Definition | Post-1752 years: Leap years are those that are either 1) divisible by 4 and not divisible by 100, or 2) divisible by 400. Pre-1752 years: Leap years are those that are divisible by 4. |
| Note | Microsoft Visual Basic applies the post-1752 formula to all years to determine if they are leap years. |
| v1.1 BugFix | Changed this function to correctly consider certain pre-1752 years (100, 200, 300, 500, 600, 700, 900, 1000, 1100, 1300, 1400, 1500, 1700) to be leap years. |