Public Sub VolumeCalculator()
Dim Height_x As Long
Dim Height_t As Long
Dim Height_m As Long
Dim Height_b As Long
Dim Volume As Long
Dim Radius As Long
Height_x = Range("C4").Value
Height_t = Range("C7").Value
Height_m = Range("C5").Value
Height_b = Range("C8").Value
Volume = 0
Radius = (Range("C6").Value) / 2
If Height_x > Height_t Then
Height_x = Height_x - Height_t
If Height_x > Height_m Then
Height_x = Height_x - Height_m
If Height_x > Height_b Then
Height_x = 0
Else: Height_x = Height_b - Height_x
Volume Fn
Else: Height_x = Height_m - Height_x
Volume Fn
Else: Height_x = Height_t - Height_x
Volume Fn
Range("G9").Value = Volume
End Sub
I get a compile error saying "Else with no If" on the else that I bolded within the quotations.