[Déplacé VB6 --> VBA] excel macro vba

Signaler
Messages postés
1
Date d'inscription
mercredi 20 septembre 2006
Statut
Membre
Dernière intervention
2 mars 2010
-
Messages postés
14008
Date d'inscription
samedi 29 décembre 2001
Statut
Modérateur
Dernière intervention
28 août 2015
-
j'ai un problem lors de l'excution du macro ,le code aasocié en vba affiche une erreur de compilation "sub ou function non defini",le code est le suivant:
Sub macro3()
' Macro3 Macro
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$D$11", Relation:=1, FormulaText:="1"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$D$11", Relation:=3, FormulaText:="0"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$D$17", Relation:=3, FormulaText:="0"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$D$20", Relation:=1, FormulaText:="1"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$D$8", Relation:=3, FormulaText:="0"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$D$20", Relation:=3, FormulaText:="0"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$E$11", Relation:=1, FormulaText:="1"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$E$11", Relation:=3, FormulaText:="0"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$E$17", Relation:=3, FormulaText:="0"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$E$20", Relation:=1, FormulaText:="1"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$E$20", Relation:=3, FormulaText:="0"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$E$8", Relation:=3, FormulaText:="0"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$J$11", Relation:=1, FormulaText:="1"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$J$11", Relation:=3, FormulaText:="0"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$J$8", Relation:=3, FormulaText:="0"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$K$11", Relation:=1, FormulaText:="1"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$K$11", Relation:=3, FormulaText:="0"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverDelete CellRef:="$K$8", Relation:=3, FormulaText:="0"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverAdd CellRef:="$D$8", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$E$8", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$D$11", Relation:=1, FormulaText:="1"
SolverAdd CellRef:="$D$11", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$E$11", Relation:=1, FormulaText:="1"
SolverAdd CellRef:="$E$11", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$J$8", Relation:=3, FormulaText:="0"""
SolverAdd CellRef:="$K$8", Relation:=3, FormulaText:="0"""
SolverAdd CellRef:="$J$11", Relation:=1, FormulaText:="1"
SolverAdd CellRef:="$J$11", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$K$11", Relation:=1, FormulaText:="1"
SolverAdd CellRef:="$K$11", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$D$17", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$E$17", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$D$20", Relation:=1, FormulaText:="1"
SolverAdd CellRef:="$D$20", Relation:=1, FormulaText:="0"
SolverAdd CellRef:="$E$20", Relation:=1, FormulaText:="1"
SolverAdd CellRef:="$E$20", Relation:=3, FormulaText:="0"
SolverOk SetCell:="$F$57", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$D$8:$E$8,$D$11:$E$11,$J$8:$K$8,$J$11:$K$11,$D$17:$E$17,$D$20:$E$20"
SolverSolve
End Sub
la premiere ligne est marqué par le jaune et la troisieme par le bleu.
je travail avec l'office 2007,j'ai bien cherché la cause de l'eereur,ils m'ont dit qu'il faut ajouter des reférences"solver.xls"mais je la trouve pas.si quelqu'un peut m'aider ?!




chapeau

1 réponse

Messages postés
14008
Date d'inscription
samedi 29 décembre 2001
Statut
Modérateur
Dernière intervention
28 août 2015
75
BONJOUR aussi
"la premiere ligne est marqué par le jaune et la troisieme par le bleu"
Que la vie est parfois un grand mystère ...

Solveur = Macro complémentaire.
A toi de trouver le menu Outils ...

Vala
Jack, MVP VB
NB : Je ne répondrai pas aux messages privés

Le savoir est la seule matière qui s'accroit quand on la partage (Socrate)