|
发表于 2020-6-1 01:30:01
|
显示全部楼层
Private Sub Command1_Click()
Dim i As Integer
Dim datTemp As Date
For i = 2010 To 2050
datTemp = GetLastDate_Month(DateSerial(i, 2, 1))
If Day(datTemp) = 29 Then
Debug.Print i
End If
Next i
End Sub
Private Function GetLastDate_Month(ByVal datDate As Date) As Date
GetLastDate_Month = DateAdd("d", -Day(DateAdd("m", 1, datDate)), DateAdd("m", 1, datDate))
End Function |
|