VB-取日期属于星期几
有时会比较常用了,很简单但我记不住。
调用: "星期" & ToCN(Weekday(date, vbMonday))
Function ToCN(i As Integer) As String
Select Case i
Case 1
ToCN = "一"
Case 2
ToCN = "二"
Case 3
ToCN = "三"
Case 4
ToCN = "四"
Case 5
ToCN = "五"
Case 6
ToCN = "六"
Case 7
ToCN = "天"
End Select
End Function
调用: "星期" & ToCN(Weekday(date, vbMonday))
Function ToCN(i As Integer) As String
Select Case i
Case 1
ToCN = "一"
Case 2
ToCN = "二"
Case 3
ToCN = "三"
Case 4
ToCN = "四"
Case 5
ToCN = "五"
Case 6
ToCN = "六"
Case 7
ToCN = "天"
End Select
End Function