普通IF语句
if score<60 Then
cells(8,6)="及格"
Else
cells(8,6)="不及格"
End If
多重if语句
if score>80 then
cells(8,6)="A"
ElseIf score>70 then
cells(8,6)="B"
Else score>60
cells(8,6)="C"
End if
本文详细讲解了VBA中的IF语句,包括基础的普通IF语句及其在编程中的应用,以及如何使用多重IF语句进行复杂条件判断。通过学习,读者将能掌握VBA中IF语句的运用技巧。
普通IF语句
if score<60 Then
cells(8,6)="及格"
Else
cells(8,6)="不及格"
End If
多重if语句
if score>80 then
cells(8,6)="A"
ElseIf score>70 then
cells(8,6)="B"
Else score>60
cells(8,6)="C"
End if

被折叠的 条评论
为什么被折叠?