Fonction Excel à appliquer dans Access

Résolu
giancomo Messages postés 15 Date d'inscription lundi 4 mai 2009 Statut Membre Dernière intervention 19 juin 2009 - 3 juin 2009 à 17:35
cs_rt15 Messages postés 3874 Date d'inscription mardi 8 mars 2005 Statut Modérateur Dernière intervention 7 novembre 2014 - 3 juin 2009 à 18:46
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Cdiabirak%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Georgia;
panose-1:2 4 5 2 5 4 5 2 3 3;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:647 0 0 0 159 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
mso-no-proof:yes;}
span.EmailStyle15
{mso-style-type:personal;
mso-style-noshow:yes;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
font-family:Arial;
mso-ascii-font-family:Arial;
mso-hansi-font-family:Arial;
mso-bidi-font-family:Arial;
color:windowtext;}
@page Section1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tableau Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]-->

Bonjour tout le monde,






 J'ai un petit souci (enfin de ce que j'en sais, il a l'air petit). je code en VBA.






Je veux
utiliser la fonction ValeurCible (GoalSeek) d’Excel sous access. Apparement,
une fois la référence coché je peux utiliser les fonctions d’exel sur des
objets access (dans mon cas une requête). J’ai déterminer une fonction
valeurcible qui fait ce que ferait ma fonction GoalSeek, je l’ai intégré sous
la forme d’un module. Et j’utilise cette fonction dans ma requête où sont
présente toutes les sous étapes pour le calcul. Voici la syntaxe de ma fonction :






 






Option
Compare Database






 






Function
ValeurCible(Cellule_Cible, Cible, Cellule_modifié) As Double






 






'
Cellule_Cible : chemin du champ ou de la cellule





'
Cible : Valeur cible





'
Cellule_modifié: Résultats)






 






ValeurCible
Cellule_Cible.GoalSeek(Goal:Cible, ChangingCell:=Cellule_modifié)






 






End
Function






 






Dans Excel,
j’ai cette syntaxe :






 






Range("B52").GoalSeek Goal:=0,
ChangingCell:=Range("B55")






 






Et la
fonction entrée dans ma requête est celle-ci :






 






ACDbis:
ValeurCible([delta V];0;[CARACT_CUVE]![ACD])






 






Où delta V
est une diiférence de tension dont l’une est dépendante de l’ACD intégré dans
la requête.






 






Donc moi je
pense qu’il y’a des incohérence au niveau dde la syntaxe de la fonction
ValeurCible il ne comprend pas la « cellule cible » apparement. Parce
que j’ai utilisé plusieurs fonctions jusqu’à présent et elles marchent, donc la
syntaxe de ma requête ne doit pas avoir de problème.




Voilà en gros le problème, si quelqu'un voi un débt d'élément de solution ça pourrait m'être trés utile.

A bientot

1 réponse

cs_rt15 Messages postés 3874 Date d'inscription mardi 8 mars 2005 Statut Modérateur Dernière intervention 7 novembre 2014 13
3 juin 2009 à 18:46
Salut,

Pourquoi poster sur delphifr si c'est du vba ? -> vbfrance.

[ déplacé sur vbfrance ]
3
Rejoignez-nous