找回密码
 立即注册
搜索

途迹耕耘

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

GMT+8, 2025-12-21 21:48 , Processed in 0.214946 second(s), 14 queries .

[基础规则] IF 判断语句

[复制链接]
admin 发表于 2019-9-19 18:37:07 | 显示全部楼层 |阅读模式
1、最规范的判断语句
  1. If score >= 60 Then
  2.     Cells(8,6) = “及格‘
  3. Else
  4.     Cells(8,6) = "不及格"
  5. End If
复制代码

2、Elseif语句
  1. If score >= 85 Then
  2.     Cells(8,6) = “A‘
  3. Elseif score >= 75 Then
  4.     Cells(8,6) = "B"
  5. Elseif score >= 60 Then
  6.     Cells(8,6) = "C"
  7. Else
  8.     Cells(8,6) = "D"
  9. End If
复制代码