寻VB程序代码:输入一个数字(1~7),通过choose函数显示对应的星期一到星期日

2025-06-25 02:37:49
推荐回答(1个)
回答1:

Private Sub form_click()
Dim n As Integer
n = InputBox("请输入:")
If n < 1 Or n > 7 Then
MsgBox ("输入的数必须在1-7之间")
End If
Print choose(n)
End Sub

Function choose(m As Integer)
choose = WeekdayName(m)
End Function