自己写个函数Function ConvMonth(ByVal iMonth as Integer) as String Select Case iMonth Case 1 ConvMonth = "Jun" Case 2 ConvMonth = "Feb" . . . Case 12 ConvMonth = "..." End Function不好意思,英文不好,英文的月份不会写了,见谅
Private Sub Command1_Click() Dim Month As Byte Month = 2 MsgBox Format(DateAdd("m", Month, #12/31/1899#), "mmm") End Sub
呵呵, 谢谢各位。仔细看看format的用法, 功能真强, 还是format好。
发现一个问题。 用format 好像不能显示 出这样的效果: 对应 月份的 完整 单词。就用 case 算了。
Select Case iMonth
Case 1
ConvMonth = "Jun"
Case 2
ConvMonth = "Feb"
.
.
.
Case 12
ConvMonth = "..."
End Function不好意思,英文不好,英文的月份不会写了,见谅
Dim Month As Byte
Month = 2
MsgBox Format(DateAdd("m", Month, #12/31/1899#), "mmm")
End Sub
还是format好。