引用:
作者: mini
這很簡單,加在 select case 上即可
Select Case LCase(Week)
|
大大的指導,讓我恍然大悟,已解決.
初學者還有個問題想請教大大,
若表單的程式碼如下,會無法顯示.
Private Sub Form_Load()
Dim WeeK As String
WeeK = InputBox ("請輸入一星期7天的英文單字:")
Select Case LCase(Week)
Case "sunday" : Print "Sunday 是星期日"
Case "monday" : Print "Monday 是星期一"
Case "tuesday" : Print "Tuesday 是星期二"
Case "wednesday" : Print "Wednesday 是星期三"
Case "thursday" : Print "Thursday 是星期四"
Case "friday" : Print "Friday 是星期五"
Case "saturday" : Print "Saturday 是星期六"
End Select
End Sub
--------------------------------------------------
若表單的程式碼如下,可以顯示.
Private Sub Form_Active()
Dim WeeK As String
WeeK = InputBox ("請輸入一星期7天的英文單字:")
Select Case LCase(Week)
Case "sunday" : Print "Sunday 是星期日"
Case "monday" : Print "Monday 是星期一"
Case "tuesday" : Print "Tuesday 是星期二"
Case "wednesday" : Print "Wednesday 是星期三"
Case "thursday" : Print "Thursday 是星期四"
Case "friday" : Print "Friday 是星期五"
Case "saturday" : Print "Saturday 是星期六"
End Select
End Sub
謝謝指導!