<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Forum du club des développeurs et IT Pro - Macros et VBA Excel</title>
		<link>https://www.developpez.net/forums/</link>
		<description><![CDATA[Vos questions relatives aux macros Excel, à l'utilisation de VBA et à l'automatisation de vos classeurs Excel.]]></description>
		<language>fr</language>
		<lastBuildDate>Sat, 05 Sep 2026 06:55:44 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>15</ttl>
		<image>
			<url>https://forum.developpez.be/images/misc/rss.png</url>
			<title>Forum du club des développeurs et IT Pro - Macros et VBA Excel</title>
			<link>https://www.developpez.net/forums/</link>
		</image>
		<item>
			<title><![CDATA[[XL-365] Intégration Python avec Excel]]></title>
			<link>https://www.developpez.net/forums/showthread.php?t=2184995&amp;goto=newpost</link>
			<pubDate>Wed, 05 Aug 2026 08:42:21 GMT</pubDate>
			<description>Bonjour, 
 
je viens de...</description>
			<content:encoded><![CDATA[<div>Bonjour,<br />
<br />
je viens de découvrir qu'Excel sait intégrer du code Python, quelqu'un à-t-il déjà exploré cette possibilité<br />
<br />
Mon application Excel devant maintenant correspondre avec une application externe écrite avec Python<br />
<br />
J'ai une trouvé une vidéo intéressante sur le sujet, mais j'aimerai une retour de mise en oeuvre et des conseils<br />
<br />
Merci</div>

]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f664/logiciels/microsoft-office/excel/macros-vba-excel/">Macros et VBA Excel</category>
			<dc:creator>retraite83</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2184995/logiciels/microsoft-office/excel/macros-vba-excel/integration-python-excel/</guid>
		</item>
		<item>
			<title><![CDATA[[Toutes versions] Comment modifier la valeur d'un checkBox dans le ruban ?]]></title>
			<link>https://www.developpez.net/forums/showthread.php?t=2184885&amp;goto=newpost</link>
			<pubDate>Tue, 28 Jul 2026 16:56:36 GMT</pubDate>
			<description>Bonjour à la communauté. 
...</description>
			<content:encoded><![CDATA[<div>Bonjour à la communauté.<br />
<br />
Sur Excel Pro 2021 (pas trouvé dans le préfixe), j'ai créer un onglet dans le ruban avec un checkBox : <br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="26"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br /></div></td><td valign="top"><pre style="margin: 0">...
&lt;checkBox id=<span style="color: #FF0000;">&quot;CheckConge&quot;</span> label=<span style="color: #FF0000;">&quot;Cong&eacute;s&quot;</span> onAction=<span style="color: #FF0000;">&quot;AcXlsConge&quot;</span> getPressed=<span style="color: #FF0000;">&quot;CheckCongePressed&quot;</span>/&gt;
...</pre></td></tr></table></code><hr />
</div>Le onAction (AcXlsConge) fonctionne très bien.<br />
<br />
Mais j'aimerais, lorsque je me déplace dans la feuille concernée ou que je clique sur une cellule, que la valeur du checkBox se mette à TRUE ou FALSE selon la valeur : ligne active et colonne &quot;Conge&quot;.<br />
<br />
J'avais fais un truc comme ça :<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="26"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br />4<br />5<br /></div></td><td valign="top"><pre style="margin: 0"><span style="color: #0000ff;">Private</span> <span style="color: #0000ff;">Sub</span> Worksheet_SelectionChange<span class="br0">&#40;</span><span style="color: #0000ff;">ByVal</span> Target <span style="color: #0000ff;">As</span> Range<span class="br0">&#41;</span>
  <span style="color: #808080;">'&lt;checkBox id=&quot;CheckConge&quot; label=&quot;Cong&eacute;s&quot; onAction=&quot;AcXlsConge&quot; getPressed=&quot;CheckCongePressed&quot;/&gt;</span>
  <span style="color: #0000ff;">If</span> Cells<span class="br0">&#40;</span>ActiveCell.Row, Range<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;Conge&quot;</span><span class="br0">&#41;</span>.Column<span class="br0">&#41;</span>.Value &lt;&gt; <span style="color: #cc66cc;">0</span> <span style="color: #0000ff;">Then</span> boolResult = Target = <span style="color: #cc66cc;">1</span> <span style="color: #0000ff;">Else</span> boolResult = Target = <span style="color: #cc66cc;">0</span>
  <span style="color: #0000ff;">If</span> <span style="color: #0000ff;">Not</span> Rib <span style="color: #0000ff;">Is</span> <span style="color: #0000ff;">Nothing</span> <span style="color: #0000ff;">Then</span> Rib.InvalidateControl <span style="color: #FF0000;">&quot;CheckConge&quot;</span>
<span style="color: #0000ff;">End</span> <span style="color: #0000ff;">Sub</span></pre></td></tr></table></code><hr />
</div>Mais bien sûr, ça ne fonctionne pas (sinon, je ne serais pas là).<br />
<br />
Donc, si quelqu'un a une astuce, un conseil, une info, je suis preneur.<br />
<br />
(je n'ai rien posté ailleurs ;) )<br />
<br />
Bien à toi la communauté.<br />
<br />
Denis...</div>

]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f664/logiciels/microsoft-office/excel/macros-vba-excel/">Macros et VBA Excel</category>
			<dc:creator>DenisHen</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2184885/logiciels/microsoft-office/excel/macros-vba-excel/modifier-d-checkbox-ruban/</guid>
		</item>
		<item>
			<title>err.Number = -2147417848</title>
			<link>https://www.developpez.net/forums/showthread.php?t=2184762&amp;goto=newpost</link>
			<pubDate>Tue, 21 Jul 2026 08:51:17 GMT</pubDate>
			<description><![CDATA[Bonjour à tous, 
 
J'ai une...]]></description>
			<content:encoded><![CDATA[<div>Bonjour à tous,<br />
<br />
J'ai une erreur numéro -<b>2147417848</b> qui remonte sur une macro vba.<br />
Malheureusement l'erreur n'est pas systématique.<br />
<br />
sur les deux dernières occurences, le message remonté a été différent <br />
<br />
Debug.Print  err.Number , err.Description<br />
<br />
-2147417848   Erreur Automation L’objet invoqué s’est déconnecté de ses clients.   <br />
-2147417848   La méthode 'ModifyAppliesToRange' de l'objet 'FormatCondition' a échoué   <br />
<br />
Avez-vous déjà eu ce cas, comment le gérez vous ?<br />
<br />
merci d'avance.</div>

]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f664/logiciels/microsoft-office/excel/macros-vba-excel/">Macros et VBA Excel</category>
			<dc:creator>coyote90</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2184762/logiciels/microsoft-office/excel/macros-vba-excel/err-number-2147417848-a/</guid>
		</item>
		<item>
			<title><![CDATA[[XL-365] Somme de plusieurs colones avec critère]]></title>
			<link>https://www.developpez.net/forums/showthread.php?t=2184628&amp;goto=newpost</link>
			<pubDate>Mon, 13 Jul 2026 11:44:36 GMT</pubDate>
			<description>Bonjour le Forum 
 
Existe t...</description>
			<content:encoded><![CDATA[<div>Bonjour le Forum<br />
<br />
Existe t il une formule qui me permettrai de calculer la somme de plusieurs colonnes avec un critère <br />
<br />
exclure les tirets <br />
exclure les colonnes D c'est à dire les colonnes qui calcule la différence entre les colonnes M et C<br />
Merci d'avance pour votre aide.<br />
<br />
J'ai tenté avec SOMME.SI.ENS sans succés</div>


	<div style="padding:10px">

	

	

	

	
		<fieldset class="fieldset">
			<legend>Fichiers attachés</legend>
			<ul>
			<li>
	<img class="inlineimg" src="https://forum.developpez.be/images/attach/xlsm.gif" alt="Type de fichier : xlsm" />
	<a href="https://www.developpez.net/forums/attachments/p677493d1783942765/logiciels/microsoft-office/excel/macros-vba-excel/somme-plusieurs-colones-critere/classeur1.xlsm/">Classeur1.xlsm</a> 
(12,0 Ko)
</li>
			</ul>
		</fieldset>
	

	</div>
]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f664/logiciels/microsoft-office/excel/macros-vba-excel/">Macros et VBA Excel</category>
			<dc:creator>Zeltron59</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2184628/logiciels/microsoft-office/excel/macros-vba-excel/somme-plusieurs-colones-critere/</guid>
		</item>
		<item>
			<title><![CDATA[[XL-365] Creation d'une liste ou non dans une celulle en fonction d'une condition]]></title>
			<link>https://www.developpez.net/forums/showthread.php?t=2184555&amp;goto=newpost</link>
			<pubDate>Wed, 08 Jul 2026 15:51:15 GMT</pubDate>
			<description>Bonjour, 
 
Je suis devant un...</description>
			<content:encoded><![CDATA[<div>Bonjour,<br />
<br />
Je suis devant un petit problème.<br />
Je cherche à placer dans une celulle soit une valeur soit une liste avec le premier élément de la liste &quot;actif&quot;.<br />
<br />
J'ai un test sur Sheet1.A20 qui renvoie TRUE ou FALSE. La formule regarde si la celulle Sheet1.A1 est vide ou non.<br />
2 cas:<br />
Si TRUE alors une la valeur en Sheet1.A1 est copiée en A21 est &quot;envoyée&quot; dans Sheet2.B1<br />
Si FALSE alors une liste située en Sheet3.A1:A10 est &quot;placée&quot; dans Sheet2.B1<br />
<br />
Des calculs sont faits en fonction de la valeur de la celulle en Sheet2.B1, il est important que la celulle ne soit pas vide.<br />
<br />
J'ai essayé de faire cela avec un Sub Worsheet_Change mais j'ai lamentablement échoué. Rien ne se pass lorsque je change la valeur en Sheet1.A1.<br />
Voici un extrait du code.<br />
<br />
Je suis aussi preneur d'une solution sans VBA.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="33"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br /></div></td><td valign="top"><pre style="margin: 0">&nbsp;
<span style="color: #0000ff;">Private</span> <span style="color: #0000ff;">Sub</span> Worksheet_Change<span class="br0">&#40;</span><span style="color: #0000ff;">ByVal</span> Target <span style="color: #0000ff;">As</span> Range<span class="br0">&#41;</span>
  <span style="color: #0000ff;">If</span> <span style="color: #0000ff;">Not</span> Intersect<span class="br0">&#40;</span>Target, Range<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;A1&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span style="color: #0000ff;">Is</span> <span style="color: #0000ff;">Nothing</span> <span style="color: #0000ff;">Then</span>
    Application.EnableEvents = <span style="color: #0000ff;">False</span>
    <span style="color: #0000ff;">With</span> ThisWorkbook.Worksheets<span class="br0">&#40;</span>Sheet2<span class="br0">&#41;</span>.Range<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;B1&quot;</span><span class="br0">&#41;</span>
      <span style="color: #0000ff;">If</span> ThisWorkbook.Worksheets<span class="br0">&#40;</span>Sheet1<span class="br0">&#41;</span>.Range<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;A20&quot;</span><span class="br0">&#41;</span>.Value <span style="color: #0000ff;">Then</span>
        .Clear
        .Value = ThisWorkbook.Worksheets<span class="br0">&#40;</span>Sheet1<span class="br0">&#41;</span>.Range<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;A21&quot;</span><span class="br0">&#41;</span>.Value
      <span style="color: #0000ff;">Else</span>
        .Validation.Delete
        .Validation.Add <span style="color: #0000ff;">Type</span>:=xlValidateList, Formula1:=<span style="color: #FF0000;">&quot;=Data_trajets_noms&quot;</span>
        <span style="color: #808080;">'If you don't want the first list value of Data_trajets_noms put into B8 then remove the next line of code</span>
        .InCellDropdown = <span style="color: #0000ff;">True</span>
        .Value = ThisWorkbook.Worksheets<span class="br0">&#40;</span>Sheet3<span class="br0">&#41;</span>.Range<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;A1:A10&quot;</span><span class="br0">&#41;</span>.Cells<span class="br0">&#40;</span><span style="color: #cc66cc;">1</span><span class="br0">&#41;</span>.Value
      <span style="color: #0000ff;">End</span> <span style="color: #0000ff;">If</span>
    <span style="color: #0000ff;">End</span> <span style="color: #0000ff;">With</span>
    Application.EnableEvents = <span style="color: #0000ff;">True</span>
  <span style="color: #0000ff;">End</span> <span style="color: #0000ff;">If</span>
<span style="color: #0000ff;">End</span> <span style="color: #0000ff;">Sub</span></pre></td></tr></table></code><hr />
</div></div>

]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f664/logiciels/microsoft-office/excel/macros-vba-excel/">Macros et VBA Excel</category>
			<dc:creator>xavutrecht</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2184555/logiciels/microsoft-office/excel/macros-vba-excel/creation-d-liste-non-celulle-fonction-d-condition/</guid>
		</item>
		<item>
			<title><![CDATA[[XL-2016] Rester sur la page en cours lors de l'exécution d'une Macro avec Power Query]]></title>
			<link>https://www.developpez.net/forums/showthread.php?t=2184541&amp;goto=newpost</link>
			<pubDate>Tue, 07 Jul 2026 18:54:04 GMT</pubDate>
			<description>Bonjour, 
 
Je viens demander...</description>
			<content:encoded><![CDATA[<div>Bonjour,<br />
<br />
Je viens demander de l'aide à propos de ce code VB Excel sur lequel je buche depuis un certain temps.<br />
Je veux exécuter une série de Macros avec la fonction Call tout en restant sur la feuille actuelle (mode silencieux); ne pas afficher (ou parcourir) les feuilles concernées par le code car ne souhaitant pas que ces feuilles soient vues.<br />
Le souci est lié à la Macro qui actualise les données dans les tableaux Excel avec les requêtes Power query; quoi que je fasse, ces tableaux de données s'affichent toujours comme le montre cette vidéo: <a rel="nofollow" href="https://jumpshare.com/s/NH7nsQ6I2S8X7oWFWCTN" target="_blank">https://jumpshare.com/s/NH7nsQ6I2S8X7oWFWCTN</a><br />
<br />
Comment y remédier?<br />
Code à exécuter en premier:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="33"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br /></div></td><td valign="top"><pre style="margin: 0"><span style="color: #0000ff;">Dim</span> RunTime <span style="color: #0000ff;">As</span> <span style="color: #0000ff;">Double</span>
&nbsp;
<span style="color: #0000ff;">Sub</span> RunFirstMacro<span class="br0">&#40;</span><span class="br0">&#41;</span>
    <span style="color: #0000ff;">Dim</span> StartingSheet <span style="color: #0000ff;">As</span> Worksheet
    <span style="color: #0000ff;">Set</span> StartingSheet = ActiveSheet
&nbsp;
    <span style="color: #0000ff;">Dim</span> Response <span style="color: #0000ff;">As</span> <span style="color: #0000ff;">Integer</span>
    Response = MsgBox<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;Are you sure you want to run this macro? This action cannot be undone. Temps estim&eacute;: 05 minutes&quot;</span>, _
               vbYesNo + vbQuestion + vbDefaultButton2, <span style="color: #FF0000;">&quot;Confirm Execution&quot;</span><span class="br0">&#41;</span>
&nbsp;
      <span style="color: #0000ff;">If</span> Response = vbNo <span style="color: #0000ff;">Then</span>
        <span style="color: #0000ff;">Exit</span> <span style="color: #0000ff;">Sub</span>
    <span style="color: #0000ff;">End</span> <span style="color: #0000ff;">If</span>
&nbsp;
    Application.ScreenUpdating = <span style="color: #0000ff;">False</span>
    <span style="color: #0000ff;">Call</span> RefreshQueryTable
    <span style="color: #0000ff;">Call</span> InsertionSommeSiEnsCAClientsJAN
    <span style="color: #0000ff;">Call</span> InsertionSommeSiEnsRGTClientsJAN
    <span style="color: #0000ff;">Call</span> InsertionSommeSiEnsENGFssJAN
    <span style="color: #0000ff;">Call</span> InsertionSommeSiEnsPAYFssJAN
&nbsp;
    StartingSheet.Activate
    <span style="color: #0000ff;">Set</span> StartingSheet = <span style="color: #0000ff;">Nothing</span>
&nbsp;
    MsgBox <span style="color: #FF0000;">&quot;First macro has finished! Le processus va maintenant ajuster les colonnes. Cliquez sur Ok. Merci de patienter encore une dizaine de secondes.&quot;</span>
&nbsp;
    RunTime = Now + TimeValue<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;00:00:02&quot;</span><span class="br0">&#41;</span>
&nbsp;
     Application.OnTime RunTime, <span style="color: #FF0000;">&quot;RunSecondMacro&quot;</span>
     Application.ScreenUpdating = <span style="color: #0000ff;">True</span>
<span style="color: #0000ff;">End</span> <span style="color: #0000ff;">Sub</span></pre></td></tr></table></code><hr />
</div><br />
Code pour rafraîchir les tableaux des données (Power query) posant problème:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="26"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td valign="top"><pre style="margin: 0"><span style="color: #0000ff;">Sub</span> RefreshQueryTable<span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
    ThisWorkbook.Sheets<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;Engagements&quot;</span><span class="br0">&#41;</span>.ListObjects<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;Engagement__2&quot;</span><span class="br0">&#41;</span>.QueryTable.Refresh BackgroundQuery:=<span style="color: #0000ff;">False</span>
    ThisWorkbook.Sheets<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;Op_Bque&quot;</span><span class="br0">&#41;</span>.ListObjects<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;Op_Bque__2&quot;</span><span class="br0">&#41;</span>.QueryTable.Refresh BackgroundQuery:=<span style="color: #0000ff;">False</span>
    ThisWorkbook.Sheets<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;CLOTURE_C.A._JAN&quot;</span><span class="br0">&#41;</span>.ListObjects<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;Fact_Clts_Jan&quot;</span><span class="br0">&#41;</span>.QueryTable.Refresh BackgroundQuery:=<span style="color: #0000ff;">False</span>
    ThisWorkbook.Sheets<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;CLOTURE_CAISSE_JAN&quot;</span><span class="br0">&#41;</span>.ListObjects<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;Tableau_Donn&eacute;esExternes_1&quot;</span><span class="br0">&#41;</span>.QueryTable.Refresh BackgroundQuery:=<span style="color: #0000ff;">False</span>
&nbsp;
<span style="color: #0000ff;">End</span> <span style="color: #0000ff;">Sub</span></pre></td></tr></table></code><hr />
</div><br />
Au besoin, je peux joindre les fichiers Excel avec tous les codes.<br />
<br />
Cordialement.</div>

]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f664/logiciels/microsoft-office/excel/macros-vba-excel/">Macros et VBA Excel</category>
			<dc:creator>excelator26</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2184541/logiciels/microsoft-office/excel/macros-vba-excel/rester-page-cours-lors-l-execution-d-macro-power-query/</guid>
		</item>
		<item>
			<title><![CDATA[[Toutes versions] Trier un tableau, suppression des "vides" et des doublons]]></title>
			<link>https://www.developpez.net/forums/showthread.php?t=2184494&amp;goto=newpost</link>
			<pubDate>Sat, 04 Jul 2026 08:31:37 GMT</pubDate>
			<description>Bonjour à la communauté. 
...</description>
			<content:encoded><![CDATA[<div>Bonjour à la communauté.<br />
<br />
Dans un classeur, j'alimente des ComboBox du ruban depuis plusieurs listes contenu dans des colonnes.<br />
<br />
Capture du ruban :<br />
<img src="https://www.developpez.net/forums/attachments/p677346d1783153592/logiciels/microsoft-office/excel/macros-vba-excel/trier-tableau-suppression-vides-doublons/excel_protections_ruban.png/" border="0" alt="Nom : Excel_Protections_Ruban.png
Affichages : 119
Taille : 1,7 Ko"  style="float: CONFIG" /><br />
<br />
Les bouton de droite servent à ajouter ou remplacer le contenu des cellules dans d'autres onglets pour les calculs ou les commandes.<br />
<br />
Et petite capture de l'onglet :<br />
<img src="https://www.developpez.net/forums/attachments/p677345d1783152456/logiciels/microsoft-office/excel/macros-vba-excel/trier-tableau-suppression-vides-doublons/excel_protections.png/" border="0" alt="Nom : Excel_Protections.png
Affichages : 118
Taille : 40,8 Ko"  style="float: CONFIG" /><br />
<br />
Pour me facilité le boulo, j'ai nommé les cellules d'entête :<br />
B2 (Protect) = &quot;<i>SPMProtect</i>&quot;<br />
C2 (Nom) = &quot;<i>SPMProtectNom</i>&quot;<br />
D2 (Désignation)= &quot;<i>SPMProtectDesign</i>&quot; <br />
<br />
Et mon extrait du ruban pour cette partie :<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="26"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br /></div></td><td valign="top"><pre style="margin: 0">&lt;comboBox id=<span style="color: #FF0000;">&quot;XlsSPMProtect&quot;</span>        label=<span style="color: #FF0000;">&quot;Protection :&quot;</span>  onChange=<span style="color: #FF0000;">&quot;ChangSPMProtect&quot;</span>       sizeString=<span style="color: #FF0000;">&quot;####################&quot;</span> getItemCount=<span style="color: #FF0000;">&quot;NbSPMProtect&quot;</span>       getItemLabel=<span style="color: #FF0000;">&quot;LabelSPMProtect&quot;</span>       invalidateContentOnDrop=<span style="color: #FF0000;">&quot;true&quot;</span> /&gt;
&lt;comboBox id=<span style="color: #FF0000;">&quot;XlsSPMProtectNom&quot;</span>     label=<span style="color: #FF0000;">&quot;Nom :&quot;</span>         onChange=<span style="color: #FF0000;">&quot;ChangSPMProtectNom&quot;</span>    sizeString=<span style="color: #FF0000;">&quot;####################&quot;</span> getItemCount=<span style="color: #FF0000;">&quot;NbSPMProtectNom&quot;</span>    getItemLabel=<span style="color: #FF0000;">&quot;LabelSPMProtectNom&quot;</span>    invalidateContentOnDrop=<span style="color: #FF0000;">&quot;true&quot;</span> /&gt;
&lt;comboBox id=<span style="color: #FF0000;">&quot;XlsSPMProtectDesign&quot;</span>  label=<span style="color: #FF0000;">&quot;D&eacute;signation :&quot;</span> onChange=<span style="color: #FF0000;">&quot;ChangSPMProtectDesign&quot;</span> sizeString=<span style="color: #FF0000;">&quot;####################&quot;</span> getItemCount=<span style="color: #FF0000;">&quot;NbSPMProtectDesign&quot;</span> getItemLabel=<span style="color: #FF0000;">&quot;LabelSPMProtectDesign&quot;</span> invalidateContentOnDrop=<span style="color: #FF0000;">&quot;true&quot;</span> /&gt;</pre></td></tr></table></code><hr />
</div>J'organise mon code VBA avec :<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="26"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br /></div></td><td valign="top"><pre style="margin: 0">  FeuilSPMLstProtect = Range<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;SPMLstProtect&quot;</span><span class="br0">&#41;</span>.Worksheet.Name
  LignSPMLstProtect = Range<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;SPMLstProtect&quot;</span><span class="br0">&#41;</span>.Row + <span style="color: #cc66cc;">1</span>
  ColSPMLstProtect = Range<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;SPMLstProtect&quot;</span><span class="br0">&#41;</span>.Column</pre></td></tr></table></code><hr />
</div>Ce qui permet de renommer les onglets, ajouter des colonnes... Car je ne suis pas seul à utiliser ce classeur, mais le seul à &quot;coder&quot; (en amateur bien sur).<br />
<br />
Je ne sais pas comment alimenter mon Combo &quot;<i>XlsSPMProjet</i>&quot; sans doublons.<br />
<br />
Donc, je passe par un tableau que je rempli, je fais un tri à bulle pour l'ordre alphanumérique et je colle le tout dans une colonne (AA2), et c'est cette colonne qui alimente mon combo &quot;<i>XlsSPMProtect</i>&quot;, et qui conditionne le second Combo &quot;<i>XlsSPMProtectNom</i>&quot;, et je refait cette technique pour tous mes Combo (et j'en ai d'autres). Cette partie est d'environ 200 lignes, d'autres en ont plus.<br />
<br />
Je pense qu'il doit il y avoir une méthode pour ça, mais je ne la trouve pas.<br />
<br />
J'espère avoir été assez clair et compréhensible.<br />
<br />
Si quelqu'un(e) a une idée, un conseil, une astuce, je suis preneur.<br />
<br />
Bien à toi, la communauté.<br />
<br />
Denis...</div>


	<div style="padding:10px">

	

	
		<fieldset class="fieldset">
			<legend>Images attachées</legend>
				<div style="padding:10px">
				<img class="attach" src="https://www.developpez.net/forums/attachments/p677345d1783152456/logiciels/microsoft-office/excel/macros-vba-excel/trier-tableau-suppression-vides-doublons/excel_protections.png/" alt="" />&nbsp;<img class="attach" src="https://www.developpez.net/forums/attachments/p677346d1783153592/logiciels/microsoft-office/excel/macros-vba-excel/trier-tableau-suppression-vides-doublons/excel_protections_ruban.png/" alt="" />&nbsp;
			</div>
		</fieldset>
	

	

	

	</div>
]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f664/logiciels/microsoft-office/excel/macros-vba-excel/">Macros et VBA Excel</category>
			<dc:creator>DenisHen</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2184494/logiciels/microsoft-office/excel/macros-vba-excel/trier-tableau-suppression-vides-doublons/</guid>
		</item>
		<item>
			<title><![CDATA[[XL-365] Formule de classement final du tableau trixtettes]]></title>
			<link>https://www.developpez.net/forums/showthread.php?t=2184362&amp;goto=newpost</link>
			<pubDate>Wed, 24 Jun 2026 20:27:58 GMT</pubDate>
			<description>Bonsoir,  
qui pourrait...</description>
			<content:encoded><![CDATA[<div>Bonsoir, <br />
qui pourrait m'aider a mettre la formule dans le classement final du tableau trixtettes <br />
je n'arrive pas a mettre la formule dans le classement final pour le nombre de victoire de chaque équipes ainsi que les noms et la lettre de chaque équipes <br />
je voudrais l'employé ce samedi dans mon nouveau club de pétanque <br />
je dis déjà un grand merci a tout ceux qui voudraient m'aider a réaliser mon tableau final<br />
je joins mon fichier déjà fait en partie <br />
pour le nombre de victoire il faut que l'équipe qui gagne 13-8 par exemple  dans le tableau du classement final doit apparaitre 1 victoire  a l'équipe gagnante et 0 a l'équipe perdante <a href="https://www.developpez.net/forums/attachments/p677160d1782332800/logiciels/microsoft-office/excel/macros-vba-excel/formule-classement-final-tableau-trixtettes/for-ever-sj-trixtettes.xlsx/"  title="Nom : for ever sj trixtettes.xlsx
Affichages : 37
Taille : 37,7 Ko">for ever sj trixtettes.xlsx</a><a href="https://www.developpez.net/forums/attachments/p677160d1782332800/logiciels/microsoft-office/excel/macros-vba-excel/formule-classement-final-tableau-trixtettes/for-ever-sj-trixtettes.xlsx/"  title="Nom : for ever sj trixtettes.xlsx
Affichages : 37
Taille : 37,7 Ko">for ever sj trixtettes.xlsx</a><br />
je dis encore merci d'avance</div>


	<div style="padding:10px">

	

	

	

	
		<fieldset class="fieldset">
			<legend>Fichiers attachés</legend>
			<ul>
			<li>
	<img class="inlineimg" src="https://forum.developpez.be/images/attach/xlsx.gif" alt="Type de fichier : xlsx" />
	<a href="https://www.developpez.net/forums/attachments/p677160d1782332800/logiciels/microsoft-office/excel/macros-vba-excel/formule-classement-final-tableau-trixtettes/for-ever-sj-trixtettes.xlsx/">for ever sj trixtettes.xlsx</a> 
(37,7 Ko)
</li>
			</ul>
		</fieldset>
	

	</div>
]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f664/logiciels/microsoft-office/excel/macros-vba-excel/">Macros et VBA Excel</category>
			<dc:creator>tigre5</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2184362/logiciels/microsoft-office/excel/macros-vba-excel/formule-classement-final-tableau-trixtettes/</guid>
		</item>
		<item>
			<title><![CDATA[[XL-365] Export d'une image]]></title>
			<link>https://www.developpez.net/forums/showthread.php?t=2184203&amp;goto=newpost</link>
			<pubDate>Sat, 13 Jun 2026 10:15:32 GMT</pubDate>
			<description>Bonjour, 
 
je veux exporter...</description>
			<content:encoded><![CDATA[<div>Bonjour,<br />
<br />
je veux exporter une photo depuis une cellule d'une feuille vers un dossier externe<br />
<br />
J'ai trouvé et adapté autant que je sache le faire du code trouvé :<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="33"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br /></div></td><td valign="top"><pre style="margin: 0">&nbsp;
<span style="color: #0000ff;">Option</span> <span style="color: #0000ff;">Explicit</span>
<span style="color: #0000ff;">Sub</span> ExportphtoH<span class="br0">&#40;</span>nomphto<span class="br0">&#41;</span>
&nbsp;
<span style="color: #0000ff;">Dim</span>  phtoH <span style="color: #0000ff;">As</span> Worksheet, rng <span style="color: #0000ff;">As</span> Range, shTmp <span style="color: #0000ff;">As</span> Worksheet, chtTemp <span style="color: #0000ff;">As</span> Chart, pathPhtoH <span style="color: #0000ff;">As</span> <span style="color: #0000ff;">String</span>
&nbsp;
Application.ScreenUpdating = <span style="color: #0000ff;">False</span>
&nbsp;
<span style="color: #0000ff;">Set</span> phtoH = Sheets<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;Photo&quot;</span><span class="br0">&#41;</span>
&nbsp;
pathPhtoH = Thisworkbook.path &amp; <span style="color: #FF0000;">&quot;\TEST\&quot;</span> &amp; nomphto
<span style="color: #0000ff;">Set</span> rng = phtoH.Range<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;D15&quot;</span><span class="br0">&#41;</span>
&nbsp;
<span style="color: #0000ff;">Set</span> shTmp = Worksheets.Add
Charts.Add
ActiveChart.Location <span style="color: #0000ff;">Where</span>:=xlLocationAsObject, Name:=shTmp.Name
&nbsp;
<span style="color: #0000ff;">Set</span> chtTemp = ActiveChart
rng.CopyPicture Appearance:=xlScreen, Format:=xlPicture
chtTemp.Paste
chtTemp.Export Filename:=pathPhtoH
&nbsp;
Application.DisplayAlerts = <span style="color: #0000ff;">False</span>
shTmp.Delete
Application.DisplayAlerts = <span style="color: #0000ff;">True</span>
&nbsp;
<span style="color: #0000ff;">End</span> <span style="color: #0000ff;">Sub</span></pre></td></tr></table></code><hr />
</div>Le code marche bien à un détail (important) près :<br />
avant d'exécuter la ligne :<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">chtTemp.Export Filename:=pathPhtoH</code><hr />
</div>Je contrôle la photo dans la feuille temporaire elle est bien là mais la taille n'est plus celle de la photo d'origine en phtoH.Range(&quot;D15&quot;),  elle est plus petite, donc présente mais plus petite également dans le dossier d'export..<br />
<br />
Je me dis également qu'on doit pouvoir exporter directement la photo d'origine en phtoH.Range(&quot;D15&quot;)<br />
<br />
Beaucoup de test sans pouvoir aller plus loin</div>

]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f664/logiciels/microsoft-office/excel/macros-vba-excel/">Macros et VBA Excel</category>
			<dc:creator>retraite83</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2184203/logiciels/microsoft-office/excel/macros-vba-excel/export-d-image/</guid>
		</item>
		<item>
			<title><![CDATA[[XL-365] Envoi de mail avec thunderbird]]></title>
			<link>https://www.developpez.net/forums/showthread.php?t=2184191&amp;goto=newpost</link>
			<pubDate>Fri, 12 Jun 2026 07:11:06 GMT</pubDate>
			<description>Bonjour, 
Je viens de changer...</description>
			<content:encoded><![CDATA[<div>Bonjour,<br />
Je viens de changer d'ordinateur car mon ancien ordinateur a rendu l'âme. Je passe d'Excel 2010 à Exel 2024.<br />
Mes macros VBA Excel qui marchaient très bien en Excel 2010, ne marchent plus en Excel 2024 pour l'envoi des messages avec Thunderbird. Pouvez-vous m'aider.<br />
<br />
Voici la macro :<br />
 <br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="33"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br /></div></td><td valign="top"><pre style="margin: 0">                    sujet = <span style="color: #FF0000;">&quot;Cr&eacute;ation du document d'inscription pour la &quot;</span> &amp; NomRando &amp; <span style="color: #FF0000;">&quot; du &quot;</span> &amp; DateRando &amp; <span style="color: #FF0000;">&quot;.&quot;</span>
            sujet = Replace<span class="br0">&#40;</span>Replace<span class="br0">&#40;</span>Replace<span class="br0">&#40;</span>Replace<span class="br0">&#40;</span>sujet, <span style="color: #FF0000;">&quot;-&quot;</span>, <span style="color: #FF0000;">&quot; &quot;</span><span class="br0">&#41;</span>, <span style="color: #FF0000;">&quot;  &quot;</span>, <span style="color: #FF0000;">&quot; &quot;</span><span class="br0">&#41;</span>, <span style="color: #FF0000;">&quot;  &quot;</span>, <span style="color: #FF0000;">&quot; &quot;</span><span class="br0">&#41;</span>, <span style="color: #FF0000;">&quot; .&quot;</span>, <span style="color: #FF0000;">&quot;.&quot;</span><span class="br0">&#41;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
            body = <span style="color: #FF0000;">&quot;&lt;HTML&gt;&lt;BODY&gt;&lt;FONT COLOR='blue'SIZE=4&gt;Bonjour &quot;</span> &amp; NomInscriptionHelloAsso &amp; <span style="color: #FF0000;">&quot;,&quot;</span> &amp; <span style="color: #FF0000;">&quot;&lt;br&gt;&quot;</span> &amp; <span style="color: #FF0000;">&quot;&lt;br&gt;&quot;</span> &amp; _
            <span style="color: #FF0000;">&quot;Nous programmons la &quot;</span> &amp; NomRando &amp; <span style="color: #FF0000;">&quot; pour le &quot;</span> &amp; DateRando &amp; <span style="color: #FF0000;">&quot; &quot;</span> &amp; D&eacute;partParking &amp; <span style="color: #FF0000;">&quot;. &lt;br&gt; &lt;br&gt;&quot;</span> &amp; <span style="color: #FF0000;">&quot; Animateur : &quot;</span> &amp; NomAnimateur1 &amp; <span style="color: #FF0000;">&quot; T&eacute;l&eacute;phone : &quot;</span> &amp; TelAnimateur1 &amp; _
            <span style="color: #FF0000;">&quot; Adresse courriel : &quot;</span> &amp; AdresseAnim1 &amp; <span style="color: #FF0000;">&quot;&lt;br&gt;&quot;</span> &amp; TexteDeuxi&egrave;meAnim &amp; _
            <span style="color: #FF0000;">&quot;&lt;br&gt;&quot;</span> &amp; <span style="color: #FF0000;">&quot;&lt;br&gt;&quot;</span> &amp; <span style="color: #FF0000;">&quot;Tu voudras bien cr&eacute;er le document d'inscription pour cette randonn&eacute;e, ( &quot;</span> &amp; LCase<span class="br0">&#40;</span>Worksheets<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;Configurations&quot;</span><span class="br0">&#41;</span>.Range<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;B11&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> &amp; <span style="color: #FF0000;">&quot;, &quot;</span> &amp; LCase<span class="br0">&#40;</span>Worksheets<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;Configurations&quot;</span><span class="br0">&#41;</span>.Range<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;B13&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> &amp; <span style="color: #FF0000;">&quot; ), donner l'acc&egrave;s&quot;</span> &amp; TexteCompl&eacute;mentaire &amp; _
            <span style="color: #FF0000;">&quot;&lt;br&gt;&quot;</span> &amp; <span style="color: #FF0000;">&quot;&lt;br&gt;&quot;</span> &amp; <span style="color: #FF0000;">&quot;Retourne moi ensuite le lien d'acc&egrave;s au document d'inscription afin que je puisse l'ins&eacute;rer dans la fiche d'information avant sa diffusion.&quot;</span> &amp; <span style="color: #FF0000;">&quot;&lt;br&gt;&quot;</span> &amp; TexteInscriptionHelloCDRP &amp; <span style="color: #FF0000;">&quot;&lt;br&gt;&quot;</span> &amp; <span style="color: #FF0000;">&quot;&lt;br&gt;&quot;</span> &amp; <span style="color: #FF0000;">&quot;Cordialement&quot;</span> &amp; <span style="color: #FF0000;">&quot;&lt;br&gt;&quot;</span> &amp; <span style="color: #FF0000;">&quot;&lt;br&gt;&quot;</span> &amp; NomUtilisateurComplet &amp; <span style="color: #FF0000;">&quot;&lt;br&gt; &quot;</span> &amp; <span style="color: #FF0000;">&quot;&lt;br&gt; &quot;</span> &amp; <span style="color: #FF0000;">&quot; _ &lt;/FONT&gt;&lt;/BODY&gt;&lt;/HTML&gt;&quot;</span>
&nbsp;
&nbsp;
            body = Replace<span class="br0">&#40;</span>Replace<span class="br0">&#40;</span>Replace<span class="br0">&#40;</span>Replace<span class="br0">&#40;</span>body, <span style="color: #FF0000;">&quot;-&quot;</span>, <span style="color: #FF0000;">&quot; &quot;</span><span class="br0">&#41;</span>, <span style="color: #FF0000;">&quot;  &quot;</span>, <span style="color: #FF0000;">&quot; &quot;</span><span class="br0">&#41;</span>, <span style="color: #FF0000;">&quot;  &quot;</span>, <span style="color: #FF0000;">&quot; &quot;</span><span class="br0">&#41;</span>, <span style="color: #FF0000;">&quot; .&quot;</span>, <span style="color: #FF0000;">&quot;.&quot;</span><span class="br0">&#41;</span>
&nbsp;
            <span style="color: #808080;">' recherche de l'adresse mail de l'animateur</span>
&nbsp;
&nbsp;
             cc = <span style="color: #FF0000;">&quot;&quot;</span>
            Cci = <span style="color: #FF0000;">&quot;&quot;</span>
&nbsp;
            strcommand = messagerie
            strcommand = strcommand &amp; <span style="color: #FF0000;">&quot; -compose &quot;</span> &amp; <span style="color: #FF0000;">&quot;to='&quot;</span> &amp; destinataire &amp; <span style="color: #FF0000;">&quot;'&quot;</span>
            strcommand = strcommand &amp; <span style="color: #FF0000;">&quot;,&quot;</span> &amp; <span style="color: #FF0000;">&quot;cc='&quot;</span> &amp; cc &amp; <span style="color: #FF0000;">&quot;'&quot;</span>
            strcommand = strcommand &amp; <span style="color: #FF0000;">&quot;,&quot;</span> &amp; <span style="color: #FF0000;">&quot;bcc='&quot;</span> &amp; Cci &amp; <span style="color: #FF0000;">&quot;'&quot;</span>
            strcommand = strcommand &amp; <span style="color: #FF0000;">&quot;,&quot;</span> &amp; <span style="color: #FF0000;">&quot;subject='&quot;</span> &amp; sujet &amp; <span style="color: #FF0000;">&quot;',format='1',&quot;</span>
            strcommand = strcommand &amp; <span style="color: #FF0000;">&quot;body='&quot;</span> &amp; body &amp; <span style="color: #FF0000;">&quot;'&quot;</span>
&nbsp;
         <span style="color: #0000ff;">If</span> fichierjoint &lt;&gt; <span style="color: #FF0000;">&quot;&quot;</span> <span style="color: #0000ff;">Then</span>
            strcommand = strcommand &amp; <span style="color: #FF0000;">&quot;,&quot;</span> &amp; <span style="color: #FF0000;">&quot;attachment=file:///&quot;</span> &amp; fichierjoint
        <span style="color: #0000ff;">End</span> <span style="color: #0000ff;">If</span>
&nbsp;
         <span style="color: #0000ff;">Call</span> Shell<span class="br0">&#40;</span>strcommand, vbNormalFocus<span class="br0">&#41;</span></pre></td></tr></table></code><hr />
</div><br />
<br />
Dans le mail qui se crée apparait, l'adresse et le premier mot du sujet avec ' en premier soit pour cet exemple 'Création. Il n'y a pas de body</div>

]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f664/logiciels/microsoft-office/excel/macros-vba-excel/">Macros et VBA Excel</category>
			<dc:creator>RANDOLOISIRS</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2184191/logiciels/microsoft-office/excel/macros-vba-excel/envoi-mail-thunderbird/</guid>
		</item>
		<item>
			<title><![CDATA[[XL-365] Contrôle présence d'un réseau]]></title>
			<link>https://www.developpez.net/forums/showthread.php?t=2183960&amp;goto=newpost</link>
			<pubDate>Sat, 30 May 2026 14:47:50 GMT</pubDate>
			<description><![CDATA[Bonjour, 
 
j'ai l'habitude...]]></description>
			<content:encoded><![CDATA[<div>Bonjour,<br />
<br />
j'ai l'habitude de contrôler la présence d'un fichier par :<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><span style="color: #0000ff;">If</span> Len<span class="br0">&#40;</span>Dir<span class="br0">&#40;</span>pathServeur, vbDirectory<span class="br0">&#41;</span><span class="br0">&#41;</span> &gt; <span style="color: #cc66cc;">0</span> <span style="color: #0000ff;">Then</span></code><hr />
</div>Comment faire pour contrôler la connexion à un serveur dont l'adresse a la forme<br />
<div class="bbcode_container">
	<div class="bbcode_description">Citation:</div>
	<div class="bbcode_quote printable">
		<hr />
		
			\\192.xxx
			
		<hr />
	</div>
</div>puis la présence d'un fichier sur ce réseau<br />
<br />
Avez-vous une piste de doc sur ce sujet, mes recherches ne sont pas concluantes<br />
<br />
merci</div>

]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f664/logiciels/microsoft-office/excel/macros-vba-excel/">Macros et VBA Excel</category>
			<dc:creator>retraite83</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2183960/logiciels/microsoft-office/excel/macros-vba-excel/controle-presence-d-reseau/</guid>
		</item>
		<item>
			<title><![CDATA[[XL-2019] Blocage imprévu en VBA]]></title>
			<link>https://www.developpez.net/forums/showthread.php?t=2183900&amp;goto=newpost</link>
			<pubDate>Tue, 26 May 2026 20:50:50 GMT</pubDate>
			<description>Bonjour 
Je cherche à ranger...</description>
			<content:encoded><![CDATA[<div>Bonjour<br />
Je cherche à ranger les colonnes de la feuille ff de la même manière que celles de la feuille og en fonction des noms qui sont sur la première ligne. Je prends les noms de og un par un, je cherche où ils se trouvent dans ff et je déplace les colonnes de ff pour les mettre dans le même ordre que dans og.<br />
J'utilise une séquence a priori identique à celle que j'ai déjà utilisée ailleurs et qui fonctionne sans problème. Mais ici, quand j'ai trouvé le nom dans ff, par find, je bloque sur la position de la colonne, sur la ligne col = nomf.Column, j'ai une erreur 424, objet requis.<br />
Quelqu'un peut-il me dire ce que j'ai raté ou ce que je dois ajouter ?<br />
Merci d'avance.<br />
<br />
Je n'arrive pas à mettre ma procédure en PJ, je la reproduis ici:<br />
<br />
Dim shg As Worksheet<br />
Set shg = Worksheets(&quot;og&quot;)<br />
Dim shf As Worksheet<br />
Set shf = Worksheets(&quot;ff&quot;)<br />
<br />
'rang des dernières colonnes de og et ff<br />
lastcog = shg.Cells(1, Columns.Count).End(xlToLeft).Column<br />
lastcff = shf.Cells(1, Columns.Count).End(xlToLeft).Column<br />
<br />
'définition de la plage de recherche<br />
Set rgff = shf.Range(shf.Cells(1, 4), shf.Cells(1, lastcff))<br />
<br />
For j = 4 To lastcog<br />
    nom = shg.Cells(1, j)<br />
    If nom &lt;&gt; &quot;&quot; Then<br />
        nomf = rgff.Find(nom, LookIn:=xlValues, lookat:=xlWhole) 'recherche du nom dans ff<br />
        col = nomf.Column<br />
        shf.Columns(col).Cut<br />
        shf.Columns(j).Insert shift:=xlToRight<br />
    Else<br />
'à traiter<br />
    End If<br />
Next j</div>


	<div style="padding:10px">

	

	

	

	
		<fieldset class="fieldset">
			<legend>Fichiers attachés</legend>
			<ul>
			<li>
	<img class="inlineimg" src="https://forum.developpez.be/images/attach/txt.gif" alt="Type de fichier : txt" />
	<a href="https://www.developpez.net/forums/attachments/p676523d1779828150/logiciels/microsoft-office/excel/macros-vba-excel/blocage-imprevu-vba/procedure-plante.txt/">ma procédure qui plante.txt</a> 
(776 octets)
</li>
			</ul>
		</fieldset>
	

	</div>
]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f664/logiciels/microsoft-office/excel/macros-vba-excel/">Macros et VBA Excel</category>
			<dc:creator>jacsimo</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2183900/logiciels/microsoft-office/excel/macros-vba-excel/blocage-imprevu-vba/</guid>
		</item>
		<item>
			<title><![CDATA[[XL-365] Plantage à la fermeture d'un classeur]]></title>
			<link>https://www.developpez.net/forums/showthread.php?t=2183890&amp;goto=newpost</link>
			<pubDate>Tue, 26 May 2026 15:00:24 GMT</pubDate>
			<description><![CDATA[Bonjour, 
 
J'ai un classeur...]]></description>
			<content:encoded><![CDATA[<div>Bonjour,<br />
<br />
J'ai un classeur qui plante en le fermant en VBA. En fait, je veux que mon classeur se ferme (mais sans quitter Excel car les autres classeurs doivent rester ouverts) en faisant un clic DROIT sur une cellule.<br />
<br />
Pour vérifier si cela ne vient pas du code, j'ai fait un nouveau classeur tout bête avec uniquement (et rien d'autre) : <br />
<br />
<br />
Sur la feuille, une procédure événementielle : <br />
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)<br />
    Cancel = True<br />
    If ActiveCell.Address = &quot;$F$10&quot; Then<br />
        ThisWorkbook.Close True<br />
    End If<br />
End Sub<br />
<br />
<br />
Si je fais un clic DROIT en F10, mon classeur fait quitter Excel, mais je dirai fait &quot;planter&quot; Excel, car lorsque je le relance, j'ai un message indiquant qu'Excel ne s'est pas fermé correctement et me demande si je veux l'exécuter en mode sans échec...<br />
Bien sûr, les autres classeurs ouverts sont fermés en même temps, et s'ils n'étaient pas enregistrés, tout est perdu...<br />
<br />
J'ai essayé sans ouvrir d'autres classeur, même chose<br />
<br />
J'ai essayé avec la procédure événementielle double clic : même problème<br />
<br />
J'ai essayé avec la procédure événementielle Worksheet_SelectionChange : là ça fonctionne, Excel ferme mon classeur mais reste ouvert. Par contre, cette procédure ne m'intéresse pas, car si je clique par erreur sur la cellule, il va se fermer, et je ne souhaite pas de message demandant si je veux vraiment fermer le classeur.<br />
<br />
J'ai essayé aussi, au lieu d'utiliser directement l'instruction ThisWorkbook.Close de faire un call procédure et mettre le close dans une procédure, toujours la même anomalie.<br />
j'ai recherché sur différents sites, (mettre un do events, mettre workbooks(&quot;nomclasseur&quot;).close à la place de thisworbook, etc), mais rien ne fonctionne.<br />
<br />
<br />
Donc, pour résumer, est-ce que quelqu'un sait pourquoi : <br />
en utilisant l'instruction  ThisWorkbook.Close dans une procédure événementielle BeforeRightClick ou BeforeDoubleClick ça fait planter Excel, alors qu'avec une procédure SelectionChange le classeur se ferme bien en laissant Excel ouvert ???<br />
<br />
Merci d'avance.</div>

]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f664/logiciels/microsoft-office/excel/macros-vba-excel/">Macros et VBA Excel</category>
			<dc:creator>lesurferdu59</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2183890/logiciels/microsoft-office/excel/macros-vba-excel/plantage-fermeture-d-classeur/</guid>
		</item>
		<item>
			<title><![CDATA[[XL-365] VBA Modification reference cellule]]></title>
			<link>https://www.developpez.net/forums/showthread.php?t=2183882&amp;goto=newpost</link>
			<pubDate>Tue, 26 May 2026 10:04:23 GMT</pubDate>
			<description><![CDATA[Bonjour  
Dans le cadre d'un...]]></description>
			<content:encoded><![CDATA[<div>Bonjour <br />
Dans le cadre d'un planning, j'utilise ce code pour transposer des cycles de travail dans une grille de distribution qui rempli automatiquement un calendrier perpétuel.<br />
Je souhaite positionner la plage à copier sur le 1er lundi du mois (4ème jour de l'année par exemple). Cette valeur se calcul automatique et se range dans la cellule P1<br />
ainsi au lieu de <b>Range(&quot;E3&quot;).Select</b>, je souhaite obtenir Range(&quot;E3&quot;<b>+4</b>).Select, soit au final Range(&quot;E<b>7</b>&quot;).Select<br />
Le sujet semble si évident que le nombre de réponses est &quot;assourdissant&quot;.<br />
Auriez-vous la bonté de m'aider SVP.<br />
Merci d'avance<br />
<br />
Private Sub CommandButton1_Click()<br />
Dim réponse As Integer<br />
Dim PLAGE As Range<br />
réponse = MsgBox(&quot;Vous allez importer le cycle de travail dans les grilles mensuelles : Voulez-vous continuer ?&quot;, vbQuestion + vbYesNo)<br />
    If réponse = vbYes Then<br />
Application.ScreenUpdating = False<br />
' Transport du cycle 01 Sem dans la grille de distribution<br />
Set PLAGE = Worksheets(&quot;CYCLE&quot;).Range(&quot;S3:AA9&quot;)<br />
PLAGE.Copy<br />
Range(&quot;S3:AA9&quot;).Select<br />
    Selection.Copy<br />
    Range(&quot;E3&quot;).Select<br />
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _<br />
        :=False, Transpose:=False<br />
etc.</div>

]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f664/logiciels/microsoft-office/excel/macros-vba-excel/">Macros et VBA Excel</category>
			<dc:creator>Gestion-RH</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2183882/logiciels/microsoft-office/excel/macros-vba-excel/vba-modification-reference-cellule/</guid>
		</item>
		<item>
			<title><![CDATA[[XL-365] Contrôle numérique d'un champ]]></title>
			<link>https://www.developpez.net/forums/showthread.php?t=2183834&amp;goto=newpost</link>
			<pubDate>Fri, 22 May 2026 09:16:01 GMT</pubDate>
			<description>Bonjour,   
 
je viens de...</description>
			<content:encoded><![CDATA[<div>Bonjour,  <br />
<br />
je viens de découvrir qq chose que je n'avais jamais remarqué dans un contrôle numérique :<br />
<br />
Un champ A1 défini en numérique<br />
L'utilisateur tape un espace dans sa saisie par exempe &quot;12 4&quot;<br />
Le code suivant contrôle la numéricité<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="26"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td valign="top"><pre style="margin: 0">&nbsp;
    <span style="color: #0000ff;">If</span> IsNumeric<span class="br0">&#40;</span>test.Range<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;A1&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> = <span style="color: #0000ff;">True</span> <span style="color: #0000ff;">Then</span>
       MsgBox <span style="color: #FF0000;">&quot;OK&quot;</span>
    <span style="color: #0000ff;">Else</span>
        MsgBox <span style="color: #FF0000;">&quot;champ non num&eacute;rique&quot;</span>, Title:=titre
    <span style="color: #0000ff;">End</span> <span style="color: #0000ff;">If</span></pre></td></tr></table></code><hr />
</div>le contrôle répond &quot;OK&quot;<br />
<br />
Mais ensuite la macro se plante dans un calcul avec la valeur du champ<br />
<br />
Manque-t-il qq chose dans mon test, j'avoue être surpris et ne pas voir l'erreur de mon code VBA</div>

]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f664/logiciels/microsoft-office/excel/macros-vba-excel/">Macros et VBA Excel</category>
			<dc:creator>retraite83</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2183834/logiciels/microsoft-office/excel/macros-vba-excel/controle-numerique-d-champ/</guid>
		</item>
	</channel>
</rss>
