bonjour tout le monde
je cherche a trouver la combinaison d'une plage pour trouver la somme d'une valeur cible.
voila ce que j'ai réussi a faire pour le moment , quelqu’un peut-il m'aider svp
Sub alea()
Dim rng As Range
Dim cell As Range
Dim i As Integer
Set rng = Range(Range("A65536").End(xlUp), Range("A1"))
Do
For Each cell In rng
Cells(4, 4) = cell
Cells(4, 5) = cell
Cells(4, 6) = cell
Cells(4, 7) = Cells(4, 4) + Cells(4, 5) + Cells(4, 6)
Next
Loop While Cells(1, 7) <> Cells(4, 7)
End Sub