Sondage :

Publicité




Partenaires




Jmax-Hardware

mxdev.net

feedburner
donate.gif


331 visiteur(s) en ligne
Forums d'entraide informatique - Les forums de PCW
Utilisation solver sous VBA - Version imprimable

+- Forums d'entraide informatique - Les forums de PCW (http://forum.pcinfo-web.com)
+-- Forum : Forum Informatique (/forumdisplay.php?fid=39)
+--- Forum : Internet - Navigation -Programmation - Scripts - Developpement (/forumdisplay.php?fid=8)
+--- Discussion : Utilisation solver sous VBA (/showthread.php?tid=5293)



Utilisation solver sous VBA - Miskone - 24-01-2012 10:34 AM

bonjour, j'ai besoin d'aide, cela fait deux semaine que je crèche sur mon problème que voici. j'ai fais une macro qui utilise le solver d'excel via VB. Apparemment le code semble bon mais lorsque je lance la compilation, on me dis une erreur est survenue ou la mémoire disponible est saturée, svp chers amis programmeurs j'ai besoin d'aide.

Voici le code
Private Sub CommandButton1_Click()
'SolverReset
SolverOptions MaxTime:=100, Iterations:=100, Precision:=0.000001, Estimates:=1, SearchOption:=1, IntTolerance:=5, Convergence:=0.0001
SolverOk SetCell:="C12", MaxMinVal:=3, ValueOf:=Sheets("RNA").Range("F12"), ByChange:="RNA!$ C $ 2: $ C $ 11"
SolverAdd CellRef:="RNA!C2", Relation:=1, FormulaText:=Sheets("RNA").Range("E2")
SolverAdd CellRef:="RNA!C2", Relation:=3, FormulaText:=Sheets("RNA").Range("F2")
SolverAdd CellRef:="RNA!C3", Relation:=1, FormulaText:=Sheets("RNA").Range("E3")
SolverAdd CellRef:="RNA!C3", Relation:=3, FormulaText:=Sheets("RNA").Range("F3")
SolverAdd CellRef:="RNA!C4", Relation:=1, FormulaText:=Sheets("RNA").Range("E4")
SolverAdd CellRef:="RNA!C4", Relation:=3, FormulaText:=Sheets("RNA").Range("F4")
SolverAdd CellRef:="RNA!C5", Relation:=1, FormulaText:=Sheets("RNA").Range("E5")
SolverAdd CellRef:="RNA!C5", Relation:=3, FormulaText:=Sheets("RNA").Range("F5")
SolverAdd CellRef:="RNA!C6", Relation:=1, FormulaText:=Sheets("RNA").Range("E6")
SolverAdd CellRef:="RNA!C6", Relation:=3, FormulaText:=Sheets("RNA").Range("F6")
SolverAdd CellRef:="RNA!C7", Relation:=1, FormulaText:=Sheets("RNA").Range("E7")
SolverAdd CellRef:="RNA!C7", Relation:=3, FormulaText:=Sheets("RNA").Range("F7")
SolverAdd CellRef:="RNA!C8", Relation:=1, FormulaText:=Sheets("RNA").Range("E8")
SolverAdd CellRef:="RNA!C8", Relation:=3, FormulaText:=Sheets("RNA").Range("F8")
SolverAdd CellRef:="RNA!C9", Relation:=2, FormulaText:=Sheets("RNA").Range("E9")
SolverAdd CellRef:="RNA!C10", Relation:=1, FormulaText:=Sheets("RNA").Range("E10")
SolverAdd CellRef:="RNA!C10", Relation:=3, FormulaText:=Sheets("RNA").Range("F10")
SolverAdd CellRef:="RNA!C11", Relation:=1, FormulaText:=Sheets("RNA").Range("E11")
SolverAdd CellRef:="RNA!C11", Relation:=3, FormulaText:=Sheets("RNA").Range("F11")
SolverOk SetCell:="C12", MaxMinVal:=3, ValueOf:=Sheets("RNA").Range("E12"), ByChange:="RNA!$ C $ 2: $ C $ 11"
SolverSolve UserFinish:=False
SolverFinish KeepFinal:=1, ReportArray:=(1)
End Sub


RE: Utilisation solver sous VBA - MisterBoss - 24-01-2012 12:42 PM

Attention! triple sujet! c'est interdit!
T'es amnésique ou quoi? Big Grin


RE: Utilisation solver sous VBA - Miskone - 24-01-2012 12:49 PM

je m'excuse si j'ai outrepassé les règles du groupe, je suis nouvelle. mais svp j'ai besoin de reponse


RE: Utilisation solver sous VBA - Informaticien zero - 24-01-2012 12:58 PM

Il est censé faire quoi ce code?

Merci Smile


RE: Utilisation solver sous VBA - Miskone - 24-01-2012 13:14 PM

c'est pour optimiser mon modèle mathématique à partir des contraintes fixées.


RE: Utilisation solver sous VBA - leader.75 - 24-01-2012 13:23 PM

Bonjour et bienvenue Miskone
Aurais-tu eu un problème pour avoir posté 3 fois la même chose ?
Si oui, peux-tu nous le décrire ICI
Merci.