by Avinash More (2 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 5th May 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Simple code for Calculate Number of Days in Month
'Email: [email protected]
Private Sub NoOfDays(valDate As Date)
Dim CurMonth As Date
Dim NxtMonth As Date
Dim NDay As Integer
CurMonth = valDate
NxtMonth = DateAdd("M", 1, CurMonth)
NDay = DateDiff("d", CurMonth, NxtMonth)
MsgBox NDay
End Sub
'Example.
'Private Sub Command1_Click()
'If IsDate(Text1.Text) = False Then Exit Sub
'Call NoOfDays(Text1.Text)
'End Sub