{"id":6069,"date":"2017-05-25T08:17:42","date_gmt":"2017-05-25T08:17:42","guid":{"rendered":"https:\/\/wordherd.io\/how-to-create-your-own-vba-code-library-in-excel\/"},"modified":"2017-05-25T08:17:42","modified_gmt":"2017-05-25T08:17:42","slug":"how-to-create-your-own-vba-code-library-in-excel","status":"publish","type":"post","link":"https:\/\/wordherd.io\/es\/blog\/how-to-create-your-own-vba-code-library-in-excel\/","title":{"rendered":"How To Create Your Own VBA Code Library In Excel"},"content":{"rendered":"<p>As soon as you&#8217;ve got start creating VBA functions in Excel it is worthwhile creating your personal code library. Reusing procedures and features is sensible when just a little fantastic tuning is all it&#8217;s essential to make the code work for a present mission.<\/p>\n<p>There are a number of methods to save lots of and arrange your personal code, and this text will clarify how one can save and import code right into a VBA module when wanted.<\/p>\n<p><strong>Growing The Code Library<\/strong><\/p>\n<p>Sorting a column utilizing Excel&#8217;s type operate could be a typical code snippet you would like to save lots of. Here is the code:<\/p>\n<p><pre>Sub type()\n<br>Dim rng As Vary\n<br>Set rng = Vary(\"a1\").CurrentRegion\n<br>rng.Type Key1:=Vary(\"a1\"), Order1:=xlAscending, Header:=xlYes \n<br>finish sub<\/pre>\n<\/p>\n<p>The query is the place must you save the code so you possibly can readily entry it? One possibility is to save lots of the code right into a textual content file after which use VBA to learn the contents of the file right into a code module.<\/p>\n<p>For this instance, we have saved the code in a file known as &#8220;type.txt&#8221; in a folder known as &#8220;library&#8221; beneath the present workbook folder.<\/p>\n<p>First, we&#8217;ll outline the file and path the place the code is saved.<\/p>\n<p><pre>path = ActiveWorkbook.path & \"library\"\n<br>myFile = path &amp; \"type.txt\"<\/pre>\n<\/p>\n<p>We&#8217;ll import the file contents right into a module known as &#8220;Library&#8221;. That is merely a module to carry any code you import earlier than deciding the best way to use it.<\/p>\n<p>First, we&#8217;ll delete any earlier use of the &#8220;Library&#8221; module. We have turned off the show alerts possibility to save lots of time as a result of we undoubtedly need to delete the module.<\/p>\n<p><pre>Software.DisplayAlerts = False\n<br>For Every a In Modules\n<br>If a.Identify = \"Library\" Then\n<br>a.Delete\n<br>Exit For\n<br>Finish If Subsequent<\/pre>\n<\/p>\n<p>Now we are able to create the module &#8220;library&#8221; and import the contents of the file.<\/p>\n<p><pre>Set m = Software.Modules.Add\n<br>m.Identify = \"Library\"\n<br>m.InsertFile myFile<\/pre>\n<\/p>\n<p>It&#8217;ll rely by yourself scenario as to how finest to arrange the code library. Listed here are some concepts:<\/p>\n<ul>\n<li>Have an index file which lets you simply seek for key phrases<\/li>\n<li>Add code to the library module moderately than begin from scratch every time<\/li>\n<li>Have some customary procedures in a separate file which you need to use with out modification.<\/li>\n<\/ul>\n<p><strong>Abstract<\/strong><\/p>\n<p>In only a few traces of code, this text has proven how you need to use beforehand written code for future reference when required. It is sensible to save lots of your earlier work and VBA makes it straightforward to retrieve and seek for your personal code snippets.<\/p>\n<div class=\"source\"><a href=\"http:\/\/ezinearticles.com\/?How-To-Create-Your-Own-VBA-Code-Library-In-Excel&#038;id=7374449\">Fuente<\/a> por <a href=\"http:\/\/ezinearticles.com\/expert\/Andy_L_Gibson\/1382722\">Andy L Gibson<\/a><\/div>","protected":false},"excerpt":{"rendered":"<p>As soon as you&#8217;ve got start creating VBA functions in Excel it is worthwhile creating your personal code library. Reusing procedures and features is sensible when just a little fantastic tuning is all it&#8217;s essential to make the code work for a present mission. There are a number of methods to save lots of and [&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":[18],"tags":[598],"builders":[],"industry":[],"platform":[],"class_list":["post-6069","post","type-post","status-publish","format-standard","hentry","category-drupal","tag-drupal"],"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 Create Your Own VBA Code Library In Excel - 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\/es\/blog\/how-to-create-your-own-vba-code-library-in-excel\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Create Your Own VBA Code Library In Excel - WordHerd WordPress Migration\" \/>\n<meta property=\"og:description\" content=\"As soon as you&#8217;ve got start creating VBA functions in Excel it is worthwhile creating your personal code library. Reusing procedures and features is sensible when just a little fantastic tuning is all it&#8217;s essential to make the code work for a present mission. There are a number of methods to save lots of and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wordherd.io\/es\/blog\/how-to-create-your-own-vba-code-library-in-excel\/\" \/>\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-05-25T08:17:42+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=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"WordHerd\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-create-your-own-vba-code-library-in-excel\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-create-your-own-vba-code-library-in-excel\\\/\"},\"author\":{\"name\":\"WordHerd\",\"@id\":\"https:\\\/\\\/wordherd.io\\\/#\\\/schema\\\/person\\\/373419b97c0fbc45a3a16462bdba0fac\"},\"headline\":\"How To Create Your Own VBA Code Library In Excel\",\"datePublished\":\"2017-05-25T08:17:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-create-your-own-vba-code-library-in-excel\\\/\"},\"wordCount\":406,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/wordherd.io\\\/#organization\"},\"keywords\":[\"drupal\"],\"articleSection\":[\"Drupal\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-create-your-own-vba-code-library-in-excel\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-create-your-own-vba-code-library-in-excel\\\/\",\"url\":\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-create-your-own-vba-code-library-in-excel\\\/\",\"name\":\"How To Create Your Own VBA Code Library In Excel - WordHerd WordPress Migration\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wordherd.io\\\/#website\"},\"datePublished\":\"2017-05-25T08:17:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-create-your-own-vba-code-library-in-excel\\\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-create-your-own-vba-code-library-in-excel\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wordherd.io\\\/blog\\\/how-to-create-your-own-vba-code-library-in-excel\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wordherd.io\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Create Your Own VBA Code Library In Excel\"}]},{\"@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\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/wordherd.io\\\/#organization\",\"name\":\"WordHerd WordPress Migration\",\"url\":\"https:\\\/\\\/wordherd.io\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@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\":\"es\",\"@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\\\/es\\\/blog\\\/author\\\/wordherd\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Create Your Own VBA Code Library In Excel - 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\/es\/blog\/how-to-create-your-own-vba-code-library-in-excel\/","og_locale":"es_ES","og_type":"article","og_title":"How To Create Your Own VBA Code Library In Excel - WordHerd WordPress Migration","og_description":"As soon as you&#8217;ve got start creating VBA functions in Excel it is worthwhile creating your personal code library. Reusing procedures and features is sensible when just a little fantastic tuning is all it&#8217;s essential to make the code work for a present mission. There are a number of methods to save lots of and [&hellip;]","og_url":"https:\/\/wordherd.io\/es\/blog\/how-to-create-your-own-vba-code-library-in-excel\/","og_site_name":"WordHerd WordPress Migration","article_author":"https:\/\/www.facebook.com\/wordherdio\/","article_published_time":"2017-05-25T08:17:42+00:00","author":"WordHerd","twitter_card":"summary_large_image","twitter_creator":"@wordherdio","twitter_misc":{"Escrito por":"WordHerd","Tiempo de lectura":"2 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wordherd.io\/blog\/how-to-create-your-own-vba-code-library-in-excel\/#article","isPartOf":{"@id":"https:\/\/wordherd.io\/blog\/how-to-create-your-own-vba-code-library-in-excel\/"},"author":{"name":"WordHerd","@id":"https:\/\/wordherd.io\/#\/schema\/person\/373419b97c0fbc45a3a16462bdba0fac"},"headline":"How To Create Your Own VBA Code Library In Excel","datePublished":"2017-05-25T08:17:42+00:00","mainEntityOfPage":{"@id":"https:\/\/wordherd.io\/blog\/how-to-create-your-own-vba-code-library-in-excel\/"},"wordCount":406,"commentCount":0,"publisher":{"@id":"https:\/\/wordherd.io\/#organization"},"keywords":["drupal"],"articleSection":["Drupal"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wordherd.io\/blog\/how-to-create-your-own-vba-code-library-in-excel\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wordherd.io\/blog\/how-to-create-your-own-vba-code-library-in-excel\/","url":"https:\/\/wordherd.io\/blog\/how-to-create-your-own-vba-code-library-in-excel\/","name":"How To Create Your Own VBA Code Library In Excel - WordHerd WordPress Migration","isPartOf":{"@id":"https:\/\/wordherd.io\/#website"},"datePublished":"2017-05-25T08:17:42+00:00","breadcrumb":{"@id":"https:\/\/wordherd.io\/blog\/how-to-create-your-own-vba-code-library-in-excel\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wordherd.io\/blog\/how-to-create-your-own-vba-code-library-in-excel\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wordherd.io\/blog\/how-to-create-your-own-vba-code-library-in-excel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wordherd.io\/"},{"@type":"ListItem","position":2,"name":"How To Create Your Own VBA Code Library In Excel"}]},{"@type":"WebSite","@id":"https:\/\/wordherd.io\/#website","url":"https:\/\/wordherd.io\/","name":"Migraci\u00f3n de WordHerd a WordPress","description":"Servicios de migraci\u00f3n de sitios 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":"es"},{"@type":"Organization","@id":"https:\/\/wordherd.io\/#organization","name":"Migraci\u00f3n de WordHerd a WordPress","url":"https:\/\/wordherd.io\/","logo":{"@type":"ImageObject","inLanguage":"es","@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":"es","@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\/es\/blog\/author\/wordherd\/"}]}},"_links":{"self":[{"href":"https:\/\/wordherd.io\/es\/wp-json\/wp\/v2\/posts\/6069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordherd.io\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordherd.io\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordherd.io\/es\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/wordherd.io\/es\/wp-json\/wp\/v2\/comments?post=6069"}],"version-history":[{"count":0,"href":"https:\/\/wordherd.io\/es\/wp-json\/wp\/v2\/posts\/6069\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordherd.io\/es\/wp-json\/wp\/v2\/media?parent=6069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordherd.io\/es\/wp-json\/wp\/v2\/categories?post=6069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordherd.io\/es\/wp-json\/wp\/v2\/tags?post=6069"},{"taxonomy":"builders","embeddable":true,"href":"https:\/\/wordherd.io\/es\/wp-json\/wp\/v2\/builders?post=6069"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/wordherd.io\/es\/wp-json\/wp\/v2\/industry?post=6069"},{"taxonomy":"platform","embeddable":true,"href":"https:\/\/wordherd.io\/es\/wp-json\/wp\/v2\/platform?post=6069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}