Private
Sub
CommandButton1_Click()
Dim
age
As
Integer
Dim
weight
As
Double
Dim
size
As
Double
Dim
bmi
As
Double
Dim
agestr
As
String
Dim
weightstr
As
String
Dim
sizestr
As
String
Dim
bmiint
As
Integer
agestr = TextBox1.Value
weightstr = TextBox2.Value
sizestr = TextBox3.Value
age =
CInt
(agestr)
weight = Val(weightstr)
size = Val(sizestr)
bmi = weight / (size * size)
bmiint =
CInt
(bmi)
If
age > 19
Then
<em> <strong>
If
OptionsButton1.Value =
True
Then
</strong></em>
If
(bmiint < 20)
Then
MsgBox (
"Sie haben Untergewicht!"
)
End
If
If
(19 < bmiint < 25)
Then
MsgBox (
"Sie haben Normalgewicht!"
)
End
If
If
(24 < bmiint < 30)
Then
MsgBox (
"Sie haben Übergewicht!"
)
End
If
If
(29 < bmiint < 40)
Then
MsgBox (
"Sie haben Adipositas!"
)
End
If
If
(bmiint > 39)
Then
MsgBox (
"Sie haben starke Adipositas!"
)
End
If
End
If
If
OptionsButton2.Value =
True
Then
If
(bmiint < 19)
Then
MsgBox (
"Sie haben Untergewicht!"
)
End
If
If
(18 < bmiint < 24)
Then
MsgBox (
"Sie haben Normalgewicht!"
)
End
If
If
(24 < bmiint < 30)
Then
MsgBox (
"Sie haben Übergewicht!"
)
End
If
If
(30 < bmiint < 40)
Then
MsgBox (
"Sie haben Adipositas!"
)
End
If
If
(bmiint > 39)
Then
MsgBox (
"Sie haben starke Adipositas!"
)
End
If
End
If
End
If
If
OptionsButton1.Value =
True
Then
If
(bmiint < 15)
Then
MsgBox (
"Sie haben Untergewicht!"
)
End
If
If
(14 < bmiint < 22)
Then
MsgBox (
"Sie haben Normalgewicht!"
)
End
If
If
(21 < bmiint)
Then
MsgBox (
"Sie haben Übergewicht!"
)
End
If
End
If
If
OptionsButton2.Value =
True
Then
If
(bmiint < 17)
Then
MsgBox (
"Sie haben Untergewicht!"
)
End
If
If
(16 < bmiint < 22)
Then
MsgBox (
"Sie haben Normalgewicht!"
)
End
If
If
(21 < bmiint)
Then
MsgBox (
"Sie haben Übergewicht!"
)
End
If
End
If
End
Sub