Option Explicit
Dim BMIweight As Double
Dim BMIheight As Double
Dim BMIndex As Double
Private Sub BMI(bodyMass As Double, weightLBS As Double, heightIN As Double)
bodyMass = 4.89 * weightLBS / (heightIN/12) ^ 2
End Sub
Private Sub cmdBMI_Click()
Call BMI(BMIndex,
BMIweight,BMIheight)
lblBMI.Caption = BMIndex
End Sub
Private Sub txtHeight_Change()
BMIheight = txtHeight.Text / 12
End Sub
Private Sub txtWeight_Change()
BMIweight = txtWeight.Text
End Sub