RushiShroff
Programmer
Here is my Class Module
Project Name : CheckYear
Class Name : LeapYear
Here is my standard EXE
Project Name : TestProject
Whle clicking Run Time F5,it doesnt take me to runtime window.Rather sometimes it shows me Immediate window.
Rushi Shroff
Project Name : CheckYear
Class Name : LeapYear
Code:
Option Explicit
'Function to return if the specified year is a leap year
Public Function IsLeapYear(yr As Variant) As Boolean
'If year is divisible by 4 and not divisible by 100, or
'It is divisible by 400, it is a leap year
If (yr Mod 4 = 0 And yr Mod 100 <> 0) Or yr Mod 400 = 0 Then
IsLeapYear = True
Else
IsLeapYear = False
End If
End Function
Here is my standard EXE
Project Name : TestProject
Code:
Dim MyYear As New CheckYear
Private Sub Command1_Click()
MsgBox MyYear.IsLeapYear("1999")
End Sub
Rushi Shroff