In VB6 faccio così
'controlla l'anno bisestile
Function IsLeapYear(ByVal yr As Integer) As Boolean
If ((yr Mod 4) = 0) Then
IsLeapYear = ((yr Mod 100) > 0) Or ((yr Mod 400) = 0)
End If
End Function
Sub DateMese()
DataInizio.Text = CDate("01" & "/" & Month(Now) & "/" & Year(Now))
Select Case Month(Now)
Case 2
If IsLeapYear(Year(Now)) = True Then
gg = 29
Else
gg = 28
End If
Case 4, 6, 9, 11
gg = 30
Case Else
gg = 31
End Select
DataFine.Text = DateAdd("d", gg - 1, DataInizio.Text)
Adattala alle tue esigenze.