{"id":5702,"date":"2017-02-22T23:06:08","date_gmt":"2017-02-22T23:06:08","guid":{"rendered":"https:\/\/wordherd.io\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\/"},"modified":"2017-02-22T23:06:08","modified_gmt":"2017-02-22T23:06:08","slug":"comment-utiliser-vba-et-excel-pour-organiser-vos-fichiers-et-vos-dossiers","status":"publish","type":"post","link":"https:\/\/wordherd.io\/fr\/blog\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\/","title":{"rendered":"Comment utiliser VBA et Excel pour organiser vos fichiers et vos dossiers"},"content":{"rendered":"<p>Si le groupe de fichiers pr\u00e9sents sur votre ordinateur n\u2019est pas votre niveau de r\u00e9f\u00e9rence, vous n\u2019\u00eates pas le seul.<br \/>\n<br \/>La plupart d\u2019entre nous enregistrons tout dans une ou deux dossiers, mais \u00e0 mesure que le nombre de fichiers augmente, pourquoi ne pas tirer parti des fonctionnalit\u00e9s d\u2019Excel et de VBA pour les organiser un peu mieux.<\/p>\n<p><strong>Utilisation de l'objet File System pour enregistrer les informations de la biblioth\u00e8que dans Excel<\/strong><\/p>\n<p>Une situation typique sera probablement celle des images que vous avez sauvegard\u00e9es sur votre ordinateur portable. Nous supposons que les fichiers sont enregistr\u00e9s dans un seul dossier et que vous souhaitez les organiser dans des dossiers distincts, peut-\u00eatre en fonction de l\u2019ann\u00e9e o\u00f9 l\u2019image a \u00e9t\u00e9 enregistr\u00e9e pour la premi\u00e8re fois sur votre ordinateur portable. L\u2019Object File System (FSO) peut indexer le contenu d\u2019un dossier en quelques lignes de code VBA.<\/p>\n<p>D\u2019abord, d\u00e9finissez l\u2019emplacement du FSO et le dossier requis. Supposons que toutes les photos se trouvent dans un dossier appel\u00e9 \u201c recordsdata \u201d, qui se situe directement sous le dossier du fichier Excel que vous travaillez.<\/p>\n<p><pre>Dim fso Comme Scripting.FileSystemObject\n<br>Dim fld Comme un script.Folder\n<br>Dim f\n<br>Configurer fso = Nouvelle instance de l\u2019objet Scripting.FileSystemObject\n<br>Set fld = fso.GetFolder(ActiveWorkbook.Path &amp; \"recordsdata\")<\/pre>\n<\/p>\n<p>En raison de la possibilit\u00e9 pour VBA de d\u00e9terminer la date \u00e0 laquelle le fichier a \u00e9t\u00e9 cr\u00e9\u00e9 pour la premi\u00e8re fois, le code peut extraire les 12 mois qui peuvent \u00eatre utilis\u00e9s comme titre de dossier.<\/p>\n<p><pre>Activez la feuille de calcul (\"instance\").\n<br>Vary(\"a1\").Active\n<br>Pour chaque f dans fld.Information\n<br>yr = Yr(f.DateCr\u00e9ation)<\/p><p>Avec ActiveCell\n<br>.Offset(1, z\u00e9ro). Activer\n<br>.Worth = f.Title\n<br>.Offset(zero, 1) = CStr(yr)\n<br>Terminez par\n<br>Suivant<\/pre>\n<\/p>\n<p>La sortie du code peut ressembler \u00e0 ceci dans votre feuille de calcul.<\/p>\n<p><pre>photo1.jpg, 2010\n<br>photo2.jpg, 2008\n<br>photo3.jpg, 2007<\/pre>\n<\/p>\n<p>La proc\u00e9dure suivante consiste \u00e0 cr\u00e9er une nouvelle archive bas\u00e9e sur l\u2019ann\u00e9e, en proc\u00e9dant \u00e0 une liste des \u00e9l\u00e9ments, puis \u00e0 copier l\u2019image dans le nouvel emplacement.<\/p>\n<p><pre>var( \"a1\").activer\n<br>set rng=activeCell.currentRegion\n<br>Pour chaque f dans rng.Rows\n<br>fromPath = ActiveWorkbook.Path &amp; \"recordsdata\" &amp; f.Columns(1)\n<br>toPath = ActiveWorkbook.Path &amp; \"\" &amp; f.Columns(2) &amp; \"\"<\/pre>\n<\/p>\n<p>Si le dossier existe d\u00e9j\u00e0, nous copi\u00e9ons l\u2019image tout neuf dans ce dossier ; si c\u2019est un nouveau \u201c 12 mois \u201d, nous cr\u00e9ons un nouveau dossier.<\/p>\n<p><pre>Si Not fso.FolderExists(toPath) alors\n<br>fso.CreateFolder \u00e0 path\n<br>Terminer si\n<br>fso.CopyFile Supply:=fromPath, Destination:=toPath\n<br>Suivant<\/pre>\n<\/p>\n<p>Dans ce cas, le code copie les fichiers en fonction de l\u2019ann\u00e9e de cr\u00e9ation du fichier, mais il peut \u00e9galement \u00eatre adapt\u00e9 pour utiliser le mois ou d\u2019autres variables sp\u00e9cifiques \u00e0 une date. De plus, les classifications pouvant \u00eatre utilis\u00e9es comme noms de nouveaux dossiers peuvent \u00eatre ajout\u00e9es manuellement dans le tableau de bord avant le processus de copie.<\/p>\n<p><strong>R\u00e9sum\u00e9<\/strong><br \/>\n<br \/>Excel dispose de nombreuses fonctionnalit\u00e9s qui am\u00e9liorent votre productivit\u00e9. Cet extrait de code montre comment utiliser VBA d'une mani\u00e8re unique pour travailler avec le syst\u00e8me de fichiers et l'organisation des dossiers.<\/p>\n<div class=\"source\"><a href=\"http:\/\/ezinearticles.com\/?How-To-Use-VBA-And-Excel-To-Organize-Your-Files-And-Folders&#038;id=7458498\">Source<\/a> par <a href=\"http:\/\/ezinearticles.com\/expert\/Andy_L_Gibson\/1382722\">Andy L Gibson<\/a><\/div>","protected":false},"excerpt":{"rendered":"<p>If the group of recordsdata in your laptop will not be your robust level, you are not alone. Most of us save the whole lot in a single or two folders however because the variety of recordsdata develop, why not utilise the facility of Excel and VBA to prepare your recordsdata a bit higher. Utilizing [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","inline_featured_image":false,"footnotes":""},"categories":[15],"tags":[200,595],"builders":[],"industry":[],"platform":[],"class_list":["post-5702","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-wordpress","tag-wordpress-tutorial"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Use VBA And Excel To Organize Your Files And Folders - WordHerd WordPress Migration<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wordherd.io\/fr\/blog\/comment-utiliser-vba-et-excel-pour-organiser-vos-fichiers-et-vos-dossiers\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Use VBA And Excel To Organize Your Files And Folders - WordHerd WordPress Migration\" \/>\n<meta property=\"og:description\" content=\"If the group of recordsdata in your laptop will not be your robust level, you are not alone. Most of us save the whole lot in a single or two folders however because the variety of recordsdata develop, why not utilise the facility of Excel and VBA to prepare your recordsdata a bit higher. Utilizing [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wordherd.io\/fr\/blog\/comment-utiliser-vba-et-excel-pour-organiser-vos-fichiers-et-vos-dossiers\/\" \/>\n<meta property=\"og:site_name\" content=\"WordHerd WordPress Migration\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/wordherdio\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-02-22T23:06:08+00:00\" \/>\n<meta name=\"author\" content=\"WordHerd\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@wordherdio\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"WordHerd\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\\\/\"},\"author\":{\"name\":\"WordHerd\",\"@id\":\"https:\\\/\\\/wordherd.io\\\/#\\\/schema\\\/person\\\/373419b97c0fbc45a3a16462bdba0fac\"},\"headline\":\"How To Use VBA And Excel To Organize Your Files And Folders\",\"datePublished\":\"2017-02-22T23:06:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\\\/\"},\"wordCount\":380,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/wordherd.io\\\/#organization\"},\"keywords\":[\"WordPress\",\"wordpress tutorial\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\\\/\",\"url\":\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\\\/\",\"name\":\"How To Use VBA And Excel To Organize Your Files And Folders - WordHerd WordPress Migration\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wordherd.io\\\/#website\"},\"datePublished\":\"2017-02-22T23:06:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\\\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wordherd.io\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Use VBA And Excel To Organize Your Files And Folders\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wordherd.io\\\/#website\",\"url\":\"https:\\\/\\\/wordherd.io\\\/\",\"name\":\"WordHerd WordPress Migration\",\"description\":\"Website Migration Services\",\"publisher\":{\"@id\":\"https:\\\/\\\/wordherd.io\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wordherd.io\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/wordherd.io\\\/#organization\",\"name\":\"WordHerd WordPress Migration\",\"url\":\"https:\\\/\\\/wordherd.io\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/wordherd.io\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/wordherd.io\\\/wp-content\\\/uploads\\\/wordherd-trademark.png\",\"contentUrl\":\"https:\\\/\\\/wordherd.io\\\/wp-content\\\/uploads\\\/wordherd-trademark.png\",\"width\":1000,\"height\":315,\"caption\":\"WordHerd WordPress Migration\"},\"image\":{\"@id\":\"https:\\\/\\\/wordherd.io\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/wordherd.io\\\/#\\\/schema\\\/person\\\/373419b97c0fbc45a3a16462bdba0fac\",\"name\":\"WordHerd\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bf8c7166601a64c6c57b67ffbeab8f8c6a378cca786da9a326c1a34a2ec6f860?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bf8c7166601a64c6c57b67ffbeab8f8c6a378cca786da9a326c1a34a2ec6f860?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bf8c7166601a64c6c57b67ffbeab8f8c6a378cca786da9a326c1a34a2ec6f860?s=96&d=mm&r=g\",\"caption\":\"WordHerd\"},\"sameAs\":[\"https:\\\/\\\/wordherd.io\",\"https:\\\/\\\/www.facebook.com\\\/wordherdio\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/wordherd\",\"https:\\\/\\\/x.com\\\/wordherdio\"],\"url\":\"https:\\\/\\\/wordherd.io\\\/fr\\\/blog\\\/author\\\/wordherd\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Comment utiliser VBA et Excel pour organiser vos fichiers et vos dossiers - WordHerd WordPress Migration","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wordherd.io\/fr\/blog\/comment-utiliser-vba-et-excel-pour-organiser-vos-fichiers-et-vos-dossiers\/","og_locale":"fr_FR","og_type":"article","og_title":"How To Use VBA And Excel To Organize Your Files And Folders - WordHerd WordPress Migration","og_description":"If the group of recordsdata in your laptop will not be your robust level, you are not alone. Most of us save the whole lot in a single or two folders however because the variety of recordsdata develop, why not utilise the facility of Excel and VBA to prepare your recordsdata a bit higher. Utilizing [&hellip;]","og_url":"https:\/\/wordherd.io\/fr\/blog\/comment-utiliser-vba-et-excel-pour-organiser-vos-fichiers-et-vos-dossiers\/","og_site_name":"WordHerd WordPress Migration","article_author":"https:\/\/www.facebook.com\/wordherdio\/","article_published_time":"2017-02-22T23:06:08+00:00","author":"WordHerd","twitter_card":"summary_large_image","twitter_creator":"@wordherdio","twitter_misc":{"\u00c9crit par":"WordHerd","Dur\u00e9e de lecture estim\u00e9e":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wordherd.io\/blog\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\/#article","isPartOf":{"@id":"https:\/\/wordherd.io\/blog\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\/"},"author":{"name":"WordHerd","@id":"https:\/\/wordherd.io\/#\/schema\/person\/373419b97c0fbc45a3a16462bdba0fac"},"headline":"How To Use VBA And Excel To Organize Your Files And Folders","datePublished":"2017-02-22T23:06:08+00:00","mainEntityOfPage":{"@id":"https:\/\/wordherd.io\/blog\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\/"},"wordCount":380,"commentCount":0,"publisher":{"@id":"https:\/\/wordherd.io\/#organization"},"keywords":["WordPress","wordpress tutorial"],"articleSection":["WordPress"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wordherd.io\/blog\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wordherd.io\/blog\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\/","url":"https:\/\/wordherd.io\/blog\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\/","name":"Comment utiliser VBA et Excel pour organiser vos fichiers et vos dossiers - WordHerd WordPress Migration","isPartOf":{"@id":"https:\/\/wordherd.io\/#website"},"datePublished":"2017-02-22T23:06:08+00:00","breadcrumb":{"@id":"https:\/\/wordherd.io\/blog\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wordherd.io\/blog\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wordherd.io\/blog\/how-to-use-vba-and-excel-to-organize-your-files-and-folders\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wordherd.io\/"},{"@type":"ListItem","position":2,"name":"How To Use VBA And Excel To Organize Your Files And Folders"}]},{"@type":"WebSite","@id":"https:\/\/wordherd.io\/#website","url":"https:\/\/wordherd.io\/","name":"Migration de WordHerd vers WordPress","description":"Services de migration de sites web","publisher":{"@id":"https:\/\/wordherd.io\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wordherd.io\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/wordherd.io\/#organization","name":"Migration de WordHerd vers WordPress","url":"https:\/\/wordherd.io\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/wordherd.io\/#\/schema\/logo\/image\/","url":"https:\/\/wordherd.io\/wp-content\/uploads\/wordherd-trademark.png","contentUrl":"https:\/\/wordherd.io\/wp-content\/uploads\/wordherd-trademark.png","width":1000,"height":315,"caption":"WordHerd WordPress Migration"},"image":{"@id":"https:\/\/wordherd.io\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/wordherd.io\/#\/schema\/person\/373419b97c0fbc45a3a16462bdba0fac","name":"WordHerd","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/secure.gravatar.com\/avatar\/bf8c7166601a64c6c57b67ffbeab8f8c6a378cca786da9a326c1a34a2ec6f860?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/bf8c7166601a64c6c57b67ffbeab8f8c6a378cca786da9a326c1a34a2ec6f860?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bf8c7166601a64c6c57b67ffbeab8f8c6a378cca786da9a326c1a34a2ec6f860?s=96&d=mm&r=g","caption":"WordHerd"},"sameAs":["https:\/\/wordherd.io","https:\/\/www.facebook.com\/wordherdio\/","https:\/\/www.linkedin.com\/company\/wordherd","https:\/\/x.com\/wordherdio"],"url":"https:\/\/wordherd.io\/fr\/blog\/author\/wordherd\/"}]}},"_links":{"self":[{"href":"https:\/\/wordherd.io\/fr\/wp-json\/wp\/v2\/posts\/5702","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordherd.io\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordherd.io\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordherd.io\/fr\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/wordherd.io\/fr\/wp-json\/wp\/v2\/comments?post=5702"}],"version-history":[{"count":0,"href":"https:\/\/wordherd.io\/fr\/wp-json\/wp\/v2\/posts\/5702\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordherd.io\/fr\/wp-json\/wp\/v2\/media?parent=5702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordherd.io\/fr\/wp-json\/wp\/v2\/categories?post=5702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordherd.io\/fr\/wp-json\/wp\/v2\/tags?post=5702"},{"taxonomy":"builders","embeddable":true,"href":"https:\/\/wordherd.io\/fr\/wp-json\/wp\/v2\/builders?post=5702"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/wordherd.io\/fr\/wp-json\/wp\/v2\/industry?post=5702"},{"taxonomy":"platform","embeddable":true,"href":"https:\/\/wordherd.io\/fr\/wp-json\/wp\/v2\/platform?post=5702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}