nnsea 发表于 2023-7-2 15:26:51

VBA实例,成绩判断

Sub SelectExample()
    Dim grade As Integer
    grade = InputBox("请输入成绩:")
    Select Case grade
      Case Is >= 90
            MsgBox "优秀"
      Case Is >= 80
            MsgBox "良好"
      Case Is >= 60
            MsgBox "及格"
      Case Else
            MsgBox "不及格"
    End Select
End Sub

页: [1]
查看完整版本: VBA实例,成绩判断