?? moddateset.bas
字號:
Attribute VB_Name = "ModDateSet"
Option Explicit
Public dateSelect As Variant '選擇的日期
Public iSet As Integer '選擇的日
Public iYear As Integer '選擇的年
Public iMonth As Integer '選擇的月
Public sWeek As String
'選擇的月的天數
Public Function CountDay(Year As Integer, Month As Integer) As Integer
Dim count As Integer
On Error GoTo Err_Trap
count = -1
If Month = 1 Or Month = 3 Or Month = 5 Or Month = 7 Or Month = 8 Or Month = 10 Or Month = 12 Then
count = 31
ElseIf Month = 4 Or Month = 6 Or Month = 6 Or Month = 9 Or Month = 11 Then
count = 30
Else
If Year Mod 4 = 0 Then
count = 29
Else
count = 28
End If
If Year Mod 100 = 0 And Year Mod 400 <> 0 Then
count = 28
End If
End If
CountDay = count
Exit Function
Err_Trap:
End Function
'選擇的月的一號是星期幾
Public Function SetWeekStart(NowDate As Date) As Integer
Dim iWeekDay As Integer
Dim sStartDay As String
On Error GoTo Err_Trap
iYear = Left(NowDate, 4)
iMonth = Mid(NowDate, 6, (InStr(6, NowDate, "-") - InStr(1, NowDate, "-") - 1))
sStartDay = iYear & "-" & iMonth & "-1"
SetWeekStart = Weekday(sStartDay)
Exit Function
Err_Trap:
End Function
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -