VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Find the last day of the Month using the IsDate function.

by Aqeel Ahmed (Aroog Siddiqui) (1 Submission)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 27th July 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Find the last day of the Month using the IsDate function.

Rate Find the last day of the Month using the IsDate function.



' mail me for more code [email protected]
' for calling please note that lined 
' Call Funcation like this ---> maxDate("06","2002")

Public Function maxDate(InputMonth As Variant, InputYear As Variant)
    chkdate = ("29-" & InputMonth & "-" + InputYear)
    If Not IsDate(chkdate) Then
       maxDate = 28
       Exit Function
    End If
    chkdate = ("30-" & InputMonth & "-" + InputYear)
    If Not IsDate(chkdate) Then
       maxDate = 29
       Exit Function
    End If
    chkdate = ("31-" & InputMonth & "-" + InputYear)
    If Not IsDate(chkdate) Then
       maxDate = 30
    Else
       maxDate = 31
    End If
End Function



Download this snippet    Add to My Saved Code

Find the last day of the Month using the IsDate function. Comments

No comments have been posted about Find the last day of the Month using the IsDate function.. Why not be the first to post a comment about Find the last day of the Month using the IsDate function..

Post your comment

Subject:
Message:
0/1000 characters