bonjour,
j'ai un code comme suit :
Sub macro()
Do While Total <> -15
Calculate
valeur1 = Cells(2, 12) <= 0.7 And Cells(2, 12) >= 0.05 Or Cells(2, 12) = 0
valeur2 = Cells(2, 13) <= 0.7 And Cells(2, 13) >= 0.05 Or Cells(2, 13) = 0
valeur3 = Cells(2, 14) <= 0.7 And Cells(2, 14) >= 0.05 Or Cells(2, 14) = 0
valeur4 = Cells(2, 15) <= 0.7 And Cells(2, 15) >= 0.05 Or Cells(2, 15) = 0
valeur5 = Cells(2, 16) <= 0.7 And Cells(2, 16) >= 0.05 Or Cells(2, 16) = 0
valeur6 = Cells(20, 12) <= 0.7 And Cells(20, 12) >= 0.05 Or Cells(20, 12) = 0
valeur7 = Cells(20, 13) <= 0.7 And Cells(20, 13) >= 0.05 Or Cells(20, 13) = 0
valeur8 = Cells(20, 14) <= 0.7 And Cells(20, 14) >= 0.05 Or Cells(20, 14) = 0
valeur9 = Cells(20, 15) <= 0.7 And Cells(20, 15) >= 0.05 Or Cells(20, 15) = 0
valeur10 = Cells(20, 16) <= 0.7 And Cells(20, 16) >= 0.05 Or Cells(20, 16) = 0
valeur11 = Cells(104, 12) <= 0.7 And Cells(104, 12) >= 0.05 Or Cells(104, 12) = 0
valeur12 = Cells(104, 13) <= 0.7 And Cells(104, 13) >= 0.05 Or Cells(104, 13) = 0
valeur13 = Cells(104, 14) <= 0.7 And Cells(104, 14) >= 0.05 Or Cells(104, 14) = 0
valeur14 = Cells(104, 15) <= 0.7 And Cells(104, 15) >= 0.05 Or Cells(104, 15) = 0
valeur15 = Cells(104, 16) <= 0.7 And Cells(104, 16) >= 0.05 Or Cells(104, 16) = 0
Total = valeur1 + valeur2 + valeur3 + valeur4 + valeur5 + valeur6 + valeur7 + valeur8 + valeur9 + valeur10 + valeur11 + valeur12 + valeur13 + valeur14 + valeur15 +
Loop
End Sub
comme je l'ai deja dit dans d'autre sujets, je suis novice en VBA ^^.
mon code va environ jusqu'à 90 valeurs et arrivé là, le temps de calcul est trop long car il recalcule jusqu'à ce que toutes les valeurs répondent aux critère en même temps.
comment dois-je faire pour que le calcul de chaque valeur ne soit pas dépendant des autres??
j'espère que s'est assez clair ^^ et MERCI de bien vouloir me répondre.