kleenercectfan2
Entsperrt
hallo!
ich hab da n eigentlich kleines problem. und zwar (hab ich hausaufgaben auf
ne scherz) soll ich als hausaufgabe ein Programm in VB erstellen dass einen fragt ob man wurst oder käse kaufen will und dann preis und kg fragt aber das hab ich schon....
Jetzt hab ich die frage wie mach ich es dass wenn man z.B. abc eingibt das programm ausgeht?
ich hab da n eigentlich kleines problem. und zwar (hab ich hausaufgaben auf

Code:
Sub eurotool()
y = InputBox("Wurst oder Käse?", "Warenart")
If y = "Wurst" Then
GoTo b
End If
If y = "Käse" Then
GoTo c
End If
b:
v = Val(InputBox("KG?", "Menge"))
w = Val(InputBox("Wurstpreis?", "Preis"))
x = v * w
MsgBox "Das sind " & x & " Euro", , "Eurobetrag"
GoTo d
c:
v = Val(InputBox("Wie viel Kilogramm?", "Menge"))
w = Val(InputBox("Käsepreis?", "Preis"))
y = v * w
MsgBox "Das sind " & y & " Euro", , "eurobetrag"
d:
End Sub