332 visiteur(s) en ligne
Date actuelle : 25-04-2024, 17:05 PM Bienvenue, Visiteur ! ( Identification S'enregistrer )







 
Utilisation solver sous VBA
 
Note de cette discussion :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
Auteur Message
Miskone Hors ligne
Newbie
*

Messages : 5
Inscription : Jan 2012
Réputation : 0
Message : #1
Utilisation solver sous VBA
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
24-01-2012 10:34 AM
Trouver tous les messages de cet utilisateur Citer ce message dans une réponse




Discussions apparemment similaires...
Discussion : Auteur Réponses : Affichages : Dernier message
  VBA et Solveur sous Excel 2010 Ipso Facto 7 13 098 20-09-2011 17:01 PM
Dernier message: Troll
  [Résolu] Bug sous firefox ? Aethiryas 9 5 218 27-04-2009 22:05 PM
Dernier message: Troll

Aller à :


Utilisateur(s) parcourant cette discussion : 1 visiteur(s)