Dim valeur As Single If List1.ListIndex = -1 Then valeur = "-1" Else valeur = Val(List1.List(List1.ListIndex)) End If If List1.ListIndex = 0 Then Text35.Text = Format(CCur(Text32.Text) * (0#), "0.00") Text38.Text = Format(CCur(Text3.Text), "0.00") Text43.Text = Format(CCur(((Sqr((Text36.Text) + 4)) * Text38.Text) / 2), "0.00") Text46.Text = Format(CCur(((Text38.Text) + (CCur(Text34.Text)))), "0.00") Text31.Text = Format(CCur(((Text43.Text) + (CCur(Text35.Text)))), "0.00") End If If List1.ListIndex = -0.1 Then Text35.Text = Format(CCur(Text32.Text) * (0.1), "0.00") Text38.Text = Format(CCur(Text3.Text), "0.00") Text43.Text = Format(CCur(((Sqr((Text36.Text) + 4)) * Text38.Text) / 2), "0.00") Text46.Text = Format(CCur(((Text38.Text) + (CCur(Text34.Text)))), "0.00") Text31.Text = Format(CCur(((Text43.Text) + (CCur(Text35.Text)))), "0.00") End If If List1.ListIndex = -0.2 Then Text35.Text = Format(CCur(Text32.Text) * (0.2), "0.00") Text38.Text = Format(CCur(Text3.Text), "0.00") Text43.Text = Format(CCur(((Sqr((Text36.Text) + 4)) * Text38.Text) / 2), "0.00") Text46.Text = Format(CCur(((Text38.Text) + (CCur(Text34.Text)))), "0.00") Text31.Text = Format(CCur(((Text43.Text) + (CCur(Text35.Text)))), "0.00") End If End sub
Dim valeur As Single ' variable qui contient la valeur If List1.ListIndex = -1 Then valeur = "-1" ' valeur par défaut Else valeur = Val(List1.List(List1.ListIndex)) ' valeur sélectionnée End If
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim nombre As Single ' variable qui contient la valeur If List1.ListIndex = -1 Then nombre = 1 ' valeur par défaut (1 article acheté) Else
Dim nombre As Single ' variable qui contient la valeur If List1.ListIndex = -1 Then nombre = 1 ' valeur par défaut (1 article acheté) Else If nombre = -0.1 then TextXX.Text = ..... TextYY.Text = .... else If nombre = -0.2 then TextXX.Text = ..... TextYY.Text = .... end if end if end sub
Dim nombre As Single ' variable qui contient la valeur If List1.ListIndex = -1 Then nombre = -1 ' valeur par défaut Else nombre = Val(List1.List(List1.ListIndex)) ' valeur sélectionnée End If
Text35.Text = Format(CCur(Text32.Text) * (0#), "0.00")
Text38.Text = Format(CCur(Text3.Text), "0.00")
Text43.Text = Format(CCur(((Sqr((Text36.Text) + 4)) * Text38.Text) / 2), "0.00")
Text46.Text = Format(CCur(((Text38.Text) + (CCur(Text34.Text)))), "0.00")
Text31.Text = Format(CCur(((Text43.Text) + (CCur(Text35.Text)))), "0.00")
si ma valeur selectionnee est -1 alors
Text35.Text = Format(CCur(Text32.Text) * (0#), "0.00")
Text38.Text = Format(CCur(Text3.Text), "0.00")
Text43.Text = Format(CCur(((Sqr((Text36.Text) + 4)) * Text38.Text) / 2), "0.00")
Text46.Text = Format(CCur(((Text38.Text) + (CCur(Text34.Text)))), "0.00")
Text31.Text = Format(CCur(((Text43.Text) + (CCur(Text35.Text)))), "0.00")
mais si ma valeur sélectionnée est -1.5 alors
Text35.Text = Format(CCur(Text32.Text) * (1.5), "0.00")
Text38.Text = Format(CCur(Text3.Text), "0.00")
Text43.Text = Format(CCur((2(Sqr((Text34.Text) + 4)) * Text36.Text) / 2), "0.00")
Text46.Text = Format(CCur(((Text38.Text) + (CCur(Text34.Text)))), "0.00")
Text31.Text = Format(CCur(((Text43.Text) + (CCur(Text35.Text)))), "0.00")
Dim nombre As Single ' variable qui contient la valeur If List2.ListIndex = -6.5 Then nombre = -6.5 ' valeur par défaut à modifier si nécessaire Else nombre = Val(List2.List(List2.ListIndex)) ' valeur sélectionnée End If Select case nombre Case -6.6 mon calcul pour cette valeur Case -6.7 mon calcul pour cette valeur Case ...... Case -7.0 End Select[code=vb]
If List2.ListIndex = -6.5 Then nombre = -6.5 ' valeur par défaut à modifier si nécessaire