分享

【VBA实例】select case判断实例

 黄河简笔画 2020-04-09

  

Sub 评定级别()

Dim range As String

Dim i As Integer

For i = 2 To 11

    range = Cells(i, 2).Value

    Select Case range

    Case Is > 90

    Cells(i, 2).Offset(0, 1) = "优秀"

    Case Is > 80

    Cells(i, 2).Offset(0, 1) = "优良"

    Case Is > 70

    Cells(i, 2).Offset(0, 1) = "较好"

    Case Is > 60

    Cells(i, 2).Offset(0, 1) = "及格"

    Case Is > 0

    Cells(i, 2).Offset(0, 1) = "不及格"

    End Select

Next

End Sub

    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多