否则没有 if vba
Else without if vba
我是初学者。你能告诉我为什么会出现这个错误:“Else without IF”吗?
If ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
Else: FROM = ""
End If
Else: FROM = ""
'Notice the colon after the `Else`
编辑:第一个 ElseIf
处的错误是由隐式关闭 If
引起的。您必须在 Then
之后换行,否则 If
将被隐式关闭。
'Fixed Code:
If ComboBox3.Value = "" Then
FROM = ""
ElseIf ComboBox3.Value = "" Then
FROM = ""
'Your code continue...
End If
我是初学者。你能告诉我为什么会出现这个错误:“Else without IF”吗?
If ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
ElseIf ComboBox3.Value = "" Then FROM = ""
Else: FROM = ""
End If
Else: FROM = ""
'Notice the colon after the `Else`
编辑:第一个 ElseIf
处的错误是由隐式关闭 If
引起的。您必须在 Then
之后换行,否则 If
将被隐式关闭。
'Fixed Code:
If ComboBox3.Value = "" Then
FROM = ""
ElseIf ComboBox3.Value = "" Then
FROM = ""
'Your code continue...
End If