#### Topic: Error in the program code "End if without block if" in VBA Excel

Hello, I study at university and set the job "the quadratic equation Decision ax2+bx+c=0. In the program consider all possible checks and :A=0; B=0; C=0; A=b=0; A=c=0; A=c=0" through the form in VBA Excel.

More low attached a screen with the form as it looks. The code is written for button "Account". When I push the button produces an error in VBA "End if without block if", as though I did not try to correct, all the same somewhere it appears. Stopped on this variant of the code. Red marked where the program stops and produces an error. Therefore ask help from you how to correct and probably somehow to add the code that it regularly worked. If any additional information is necessary write I will attach further in a subject. In advance thanks for answers and the help.

```
Private Sub CommandButton1_Click ()
If Not IsNumeric (TextBox1) Or Not IsNumeric (TextBox2) Or Not IsNumeric (TextBox3) Then
MsgBox "the Initial data is entered incorrectly or not completely!", "Enter numbers"
Exit Sub
Else
a = CDbl (TextBox1)
b = CDbl (TextBox2)
c = CDbl (TextBox3)
End If
If (a = 0 And b = 0) Or (D <0) Then
MsgBox "Roots are not present"
Exit Sub
End If
If (a = 0 And c = 0) Or (b = 0 And c = 0) Then
TextBox5 = "0"
Exit Sub
End If
If a = 0 Then
If b <> 0 Then
TextBox5 =-c / b
Else
MsgBox "it is impossible to divide Into a zero!"
Exit Sub
End If
End If
If b = 0 Then
If a = 0 Then MsgBox "it is impossible to divide Into a zero!"
Exit Sub
Else
If-c / a <0 Then
MsgBox "It is impossible to derive a root from a negative number"
Exit Sub
Else
If a = 0 Then
MsgBox "it is impossible to divide Into a zero!"
Exit Sub
Else
TextBox5 = Sqr (-c / a) And TextBox6 =-Sqr (-c / a)
End If
End If
End If
>>> End If <<<
If with = 0 Then
If a <> 0 Then
TextBox5 = "0" And TextBox6 =-b / a
Else: MsgBox "it is impossible to divide Into a zero!"
Exit Sub
End If
End If
D = (b) ^ 2 *-4 * a * c
If a <> 0 And b <> 0 And c <> 0 Then
TextBox5 = (-b + Sqr (D)) / 2 * an And TextBox6 = (-b - Sqr (D)) / 2 * a
Else
MsgBox "it is impossible to divide Into a zero!"
Exit Sub
End If
End Sub
```

[img=https://ibb.co/g1QEhw]