Search Tools Links Login

Days in the Month


Visual Basic 6, or VB Classic

Calculate the number of days in a month.

Private Sub cmdGo_Click()
   Dim month_number As Integer
   Dim year_number As Integer

   month_number = Month(txtMonth.Text)
   year_number = Year(txtMonth.Text)
   MsgBox "Days: " & Format$(Day(DateSerial(year_number, month_number + 1, 0)))
End Sub

About this post

Posted: 2020-08-30
By: vb6boy
Viewed: 219 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.