Sub Test1()
Const borne1 = 0.25, borne2 = 0.35, Somme = 180
Const limite1 = 5, limite2 = 15
Dim nbNombre As Long
Application.ScreenUpdating = False
Range("e7").Resize(Rows.Count - Range("e7").Row, 2).Clear
AleaAsommeFixe Range("e7"), borne1, borne2, Somme, nbNombre
With Range("f7").Resize(nbNombre)
.Formula = Replace(Replace("=RANDBETWEEN(x,y)", "x", limite1), "y", limite2)
.Value = .Value
End With
MsgBox "Solution trouvée: " & vbLf & vbLf & nbNombre & " nombres " & _
vbLf & "pour une somme de " & Application.Sum(Range("e7").Resize(nbNombre)), vbInformation
End Sub