Userform that calculates gas mileage
You have a form -- by definition, a window in which text boxes and such can appear. Why are you using MsgBox and InputBox to communicate with the user?

If you instead put elements on the form and used those (particularly NumericUpDown), the code part would be so much simpler -- and far more like, well, a Windows app.

Watch this. Create a form, put three elements on it -- two NumericUpDown controls named GasAmountBox and DistanceBox, and one text control (text box or label, your choice really) named MileageOutput. Add other elements (like labels for the controls) to suit your taste.

Then, inside the form class, put something like:

Private Sub InputsChanged(sender As Object, e As EventArgs) _
  Handles GasAmountBox.ValueChanged, DistanceBox.ValueChanged
    If (GasAmountBox.Value = 0) Then
        MileageOutput.Text = "---"
    Else
        Dim mileage = DistanceBox.Value / GasAmountBox.Value
        MileageOutput.Text = mileage.ToString() &amp; " MPG"
    End If
End Sub


Aaaaand done.

That's the entirety of the code you have to write to make the form work.  The controls take care of ensuring that the user inputs a number. You can even set the allowable range of values, so you don't have to care about negative numbers. You can add some code to, say, round the output, if you want.