Cells(1, 2) = IIF(Cells(1, 2) >= 90, "youxiu", IIF(Cells(1, 2) >= 80, "lianghao", IIF(Cells(1, 2) >= 60, "zhongdeng"
,"Other")))
用VBA的
- Sub J_If()
- With Cells(1, 2)
- If .Value >= 90 Then
- .Value = "youxi"
- ElseIf .Value >= 80 Then
- .Value = "lianghao"
- ElseIf .Value >= 60 Then
- .Value = "zhongdong"
- Else
- .Value = "cha"
- End If
- End With
- End Sub
复制代码- Sub J_Select()
- With Cells(1, 2)
- Select Case Cells(1, 2)
- Case Is >= 90
- .Value = "youxi"
- Case Is >= 80
- .Value = "lianghao"
- Case Is >= 60
- .Value = "zhongdong"
- Case Else
- .Value = "cha"
- End Select
- End With
- End Sub
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。