Sub Fweekday()
Dim Firstday As Date
For i = 1 To 12
Firstday = Year(Now) & "-" & i
Print Firstday & "是星期" & weekday(Firstday, vbMonday)
Next
End Sub
用weekday函数。
print weekday("2009-5-1")-1 'weekday返回的数比正常多一。
也可以用变量:
r="2009"
s="5"
print weekday(r & "-" & s & "-1")-1