{"id":710,"date":"2011-07-03T18:59:47","date_gmt":"2011-07-03T16:59:47","guid":{"rendered":"http:\/\/www.auditsi.eu\/?p=710"},"modified":"2015-02-15T11:30:44","modified_gmt":"2015-02-15T10:30:44","slug":"excel-vba-supprimer-les-doublons-d%e2%80%99une-liste","status":"publish","type":"post","link":"https:\/\/www.auditsi.eu\/?p=710","title":{"rendered":"EXCEL, VBA : Supprimer les doublons d\u2019une liste"},"content":{"rendered":"<p style=\"text-align: justify;\">Le langage VBA comprend une fonction qui ne retient que les occurrences unique \u00e0 partir d\u2019une liste de donn\u00e9es\u00a0: il s\u2019agit de l\u2019instruction \u00ab\u00a0RemoveDuplicates\u00a0\u00bb (cette instruction est \u00e9quivalente \u00e0 \u00ab\u00a0Donn\u00e9es \/ Supprimer les doublons\u00a0\u00bb dans le ruban Excel 2007).<\/p>\n<p style=\"text-align: justify;\"><em><span style=\"text-decoration: underline;\">Exemple d\u2019une liste de donn\u00e9es\u00a0comprenant des doublons :<\/span><\/em><\/p>\n<table border=\"0\" width=\"58\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"20\"><\/td>\n<td valign=\"bottom\" width=\"38\"><strong>A<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"20\">1<\/td>\n<td valign=\"bottom\" width=\"38\">9<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"20\">2<\/td>\n<td valign=\"bottom\" width=\"38\">10<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"20\">3<\/td>\n<td valign=\"bottom\" width=\"38\">12<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"20\">4<\/td>\n<td valign=\"bottom\" width=\"38\">12<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"20\">5<\/td>\n<td valign=\"bottom\" width=\"38\">11<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"20\">6<\/td>\n<td valign=\"bottom\" width=\"38\">10<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"20\">7<\/td>\n<td valign=\"bottom\" width=\"38\">16<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"20\">8<\/td>\n<td valign=\"bottom\" width=\"38\">17<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"20\">9<\/td>\n<td valign=\"bottom\" width=\"38\">13<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"20\">10<\/td>\n<td valign=\"bottom\" width=\"38\">12<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"20\">11<\/td>\n<td valign=\"bottom\" width=\"38\">12<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"20\">12<\/td>\n<td valign=\"bottom\" width=\"38\">17<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: justify;\">\u00a0<em><span style=\"text-decoration: underline;\">Code-source VBA\u00a0:<\/span><\/em><\/p>\n<pre class=\"lang:default decode:true \">Sub Enl\u00e8veDoublons()\r\n  Selection.RemoveDuplicates Columns:=1, Header:=xlNo\r\nEnd Sub<\/pre>\n<p>Pour utiliser ce code, s\u00e9lectionner les donn\u00e9es (continues ici dans la plage de cellules A1:A12) puis lancer la macro VBA.<\/p>\n<p style=\"text-align: justify;\"><em><span style=\"text-decoration: underline;\">R\u00e9sultat obtenu\u00a0:<\/span><\/em><\/p>\n<table border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"24\"><\/td>\n<td valign=\"bottom\" width=\"38\"><strong>A<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"24\">1<\/td>\n<td valign=\"bottom\" width=\"38\">9<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"24\">2<\/td>\n<td valign=\"bottom\" width=\"38\">10<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"24\">3<\/td>\n<td valign=\"bottom\" width=\"38\">12<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"24\">4<\/td>\n<td valign=\"bottom\" width=\"38\">11<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"24\">5<\/td>\n<td valign=\"bottom\" width=\"38\">16<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"24\">6<\/td>\n<td valign=\"bottom\" width=\"38\">17<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"24\">7<\/td>\n<td valign=\"bottom\" width=\"38\">13<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: justify;\">La liste obtenue ne comprend que les occurrences uniques de la table de d\u00e9part.<\/p>\n<p style=\"text-align: justify;\">Approfondir le sujet : <a title=\"Programmer en VBA\" href=\"http:\/\/www.auditsi.eu\/?cat=1569\">programmer en VBA<\/a><\/p>\n<div style=\"padding-bottom:20px; padding-top:10px;\" class=\"hupso-share-buttons\"><!-- Hupso Share Buttons - https:\/\/www.hupso.com\/share\/ --><a class=\"hupso_counters\" href=\"https:\/\/www.hupso.com\/share\/\"><img decoding=\"async\" src=\"https:\/\/static.hupso.com\/share\/buttons\/lang\/fr\/share-small.png\" style=\"border:0px; padding-top:2px; float:left;\" alt=\"Share Button\"\/><\/a><script type=\"text\/javascript\">var hupso_services_c=new Array(\"twitter\",\"facebook_like\",\"facebook_send\",\"email\",\"print\",\"linkedin\");var hupso_counters_lang = \"fr_FR\";var hupso_image_folder_url = \"\";var hupso_twitter_via=\"BenoitRiviere14\";var hupso_url_c=\"\";var hupso_title_c=\"EXCEL%2C%20VBA%20%3A%20Supprimer%20les%20doublons%20d%E2%80%99une%20liste\";<\/script><script type=\"text\/javascript\" src=\"https:\/\/static.hupso.com\/share\/js\/counters.js\"><\/script><!-- Hupso Share Buttons --><\/div>","protected":false},"excerpt":{"rendered":"<p>Le langage VBA comprend une fonction qui ne retient que les occurrences unique \u00e0 partir d\u2019une liste de donn\u00e9es\u00a0: il s\u2019agit de l\u2019instruction \u00ab\u00a0RemoveDuplicates\u00a0\u00bb (cette instruction est \u00e9quivalente \u00e0 \u00ab\u00a0Donn\u00e9es \/ Supprimer les doublons\u00a0\u00bb dans le ruban Excel 2007). Exemple d\u2019une liste de donn\u00e9es\u00a0comprenant des doublons : A 1 9 2 10 3 12 4 &#8230;<\/p>\n<p><a href=\"https:\/\/www.auditsi.eu\/?p=710\" class=\"more-link\">Continue reading &lsquo;EXCEL, VBA : Supprimer les doublons d\u2019une liste&rsquo; &raquo;<\/a><\/p>\n<div style=\"padding-bottom:20px; padding-top:10px;\" class=\"hupso-share-buttons\"><!-- Hupso Share Buttons - https:\/\/www.hupso.com\/share\/ --><a class=\"hupso_counters\" href=\"https:\/\/www.hupso.com\/share\/\"><img src=\"https:\/\/static.hupso.com\/share\/buttons\/lang\/fr\/share-small.png\" style=\"border:0px; padding-top:2px; float:left;\" alt=\"Share Button\"\/><\/a><script type=\"text\/javascript\">var hupso_services_c=new Array(\"twitter\",\"facebook_like\",\"facebook_send\",\"email\",\"print\",\"linkedin\");var hupso_counters_lang = \"fr_FR\";var hupso_image_folder_url = \"\";var hupso_twitter_via=\"BenoitRiviere14\";var hupso_url_c=\"\";var hupso_title_c=\"EXCEL%2C%20VBA%20%3A%20Supprimer%20les%20doublons%20d%E2%80%99une%20liste\";<\/script><script type=\"text\/javascript\" src=\"https:\/\/static.hupso.com\/share\/js\/counters.js\"><\/script><!-- Hupso Share Buttons --><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"ngg_post_thumbnail":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[50,7,1569,215],"tags":[166,439,1633,437,438,1641],"class_list":["post-710","post","type-post","status-publish","format-standard","hentry","category-audit-de-donnees","category-breves","category-programmer-en-vba","category-vba","tag-analyse-de-donnees","tag-doublons","tag-excel","tag-removeduplicates","tag-supprimer-les-doublons","tag-vba"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/www.auditsi.eu\/index.php?rest_route=\/wp\/v2\/posts\/710","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.auditsi.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.auditsi.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.auditsi.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.auditsi.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=710"}],"version-history":[{"count":2,"href":"https:\/\/www.auditsi.eu\/index.php?rest_route=\/wp\/v2\/posts\/710\/revisions"}],"predecessor-version":[{"id":5893,"href":"https:\/\/www.auditsi.eu\/index.php?rest_route=\/wp\/v2\/posts\/710\/revisions\/5893"}],"wp:attachment":[{"href":"https:\/\/www.auditsi.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auditsi.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auditsi.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}