Task

Determine whether a given year is a leap year in the Gregorian calendar.



See also

 Leap year (wiki)


Public Sub Form_Open()
Dim dDate As Date
Dim siYear As Short = InputBox("Enter a year", "Leap year test")
Dim sMessage As String = " is a leap year."
 
Try dDate = Date(siYear, 02, 29)
If Error Then sMessage = " is not a leap year."
 
Message(siYear & sMessage)
 
End