Private Sub Form_Load() MsgBox Weekday("2005-1-10", vbSunday) End Sub
Private Sub Command1_Click() '星期几 Dim i As Integer i = Weekday(CDate("2005-1-10"), vbSunday) Select Case i Case 1 MsgBox "星期日" Case 2 MsgBox "星期一" Case 3 MsgBox "星期二" Case 4 MsgBox "星期三" Case 5 MsgBox "星期四" Case 6 MsgBox "星期五" Case 7 MsgBox "星期六" End Select End Sub
MsgBox Weekday("2005-1-10", vbSunday)
End Sub
'星期几
Dim i As Integer
i = Weekday(CDate("2005-1-10"), vbSunday)
Select Case i
Case 1
MsgBox "星期日"
Case 2
MsgBox "星期一"
Case 3
MsgBox "星期二"
Case 4
MsgBox "星期三"
Case 5
MsgBox "星期四"
Case 6
MsgBox "星期五"
Case 7
MsgBox "星期六"
End Select
End Sub