vb if 问题

来源:百度知道 编辑:UC知道 时间:2024/05/05 23:57:05
Private Sub Command8_Click()

Text45.Text = Sqr((Text1.Text ^ 2 + Text2.Text ^ 2 + Text3.Text ^ 2 + Text4.Text ^ 2 + Text5.Text ^ 2 + Text13.Text ^ 2) / 6)
Text44.Text = Round(Text45.Text)
If Text45.Text > Text44.Text Then Text44.Text = Text45.Text + 4
Else
Text44.Text = Text45.Text - 1
End If

End Sub

错误提示:Else 没有If
怎么解决呢?

Private Sub Command8_Click()

Text45.Text = Sqr((Text1.Text ^ 2 + Text2.Text ^ 2 + Text3.Text ^ 2 + Text4.Text ^ 2 + Text5.Text ^ 2 + Text13.Text ^ 2) / 6)
Text44.Text = Round(Text45.Text)
If Text45.Text > Text44.Text Then
Text44.Text = Text45.Text + 4
ElseIf 是elseif啊~~大哥!!!!!!!!
Text44.Text = Text45.Text - 1
End If

End Sub

Private Sub Command8_Click()

Text45.Text = Sqr((Text1.Text ^ 2 + Text2.Text ^ 2 + Text3.Text ^ 2 + Text4.Text ^ 2 + Text5.Text ^ 2 + Text13.Text ^ 2) / 6)
Text44.Text = Round(Text45.Text)
If Text45.Text > Text44.Text Then Text44.Text = Text45.Text + 4
Else if
Text44.Text = Text45.Text - 1
End If

End Sub

Private Sub Command8_Click()

Text45.Text = Sqr((Text1.Text ^ 2 + Text2.Text ^ 2 + Text3.Text ^ 2 + Text4.Text ^ 2 + Text5.Text ^ 2 + Text13.Text ^ 2) / 6)
Text44.Text = Round(Text45.Text)
If Text45.Text > Text4