Private Sub Command1_Click()
'定义票价变量
Dim Text1 As Single
'定义月份变量
Dim Text2 As Integer
'定义张数变量
Dim Text3 As Integer
'定义计算结果变量
Dim Text4 As Single
'根据月份处理数据
total = Text4
Select Case Text2
Case Text2 = 7 To 9
If Text2 > 20 Then
total = Text1 * Text2 * (1 - 0.15)
Else
If Text2 > 10 Then
total = Text1 * Text2 * (1 - 0.05)
Else
total = Text1 * Text2
End If
Case Text2 = 1 To 5, 10, 11
If Text2 > 20 Then
total = Text1 * Text2 * (1 - 0.25)
Else
If Text2 > 10 Then
total = Text1 * text2b * (1 - 0.15)
Else
total = Text1 * Text2
End If
Case Text2 = 6 To 12
total = Text1 * Text3
Case Else
MsgBox "月份值不合理,请重新输入!"
Exit Sub '提前退出
End Select
End Sub