{"id":1629,"date":"2024-10-18T16:31:37","date_gmt":"2024-10-18T16:31:37","guid":{"rendered":"https:\/\/smartcodebuilders.com\/wp\/?p=1629"},"modified":"2024-10-18T16:38:32","modified_gmt":"2024-10-18T16:38:32","slug":"complete-guide-to-variables-in-vba-learn-to-declare-and-use-them","status":"publish","type":"post","link":"https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/","title":{"rendered":"Complete Guide to Variables in VBA: Learn to Declare and Use Them"},"content":{"rendered":"<h2>What Are Variables in VBA and Why Are They Used?<\/h2>\n<p>Variables are fundamental elements in any programming language, including VBA. They allow you to store and manipulate data, such as numbers, text, and more complex structures. By declaring variables properly, you optimize memory usage and improve the execution speed of your code.<\/p>\n<p><strong>Real-Life Analogy<\/strong>: Imagine organizing a wardrobe. If you do it neatly, you can quickly find your clothes and make better use of the space. The same principle applies to variables in programming: by managing them correctly, you optimize their usage and capacity.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/smartcodebuilders.com\/wp\/wp-content\/uploads\/2019\/10\/Fig-1-Por-que-declarar-variables-Sin-editar.jpg\" alt=\"Proper variable management contributes to the organization and efficiency of code.\" \/><\/p>\n<p>Proper variable management contributes to the organization and efficiency of code.<\/p>\n<h2>What Is Variable Declaration in VBA?<\/h2>\n<p>Variable declaration involves instructing the system to reserve a memory space according to the type of variable needed. Although it is not mandatory to declare variables in VBA, doing so prevents slowdowns in the program since VBA won&#8217;t have to determine the type of variable each time it encounters an undeclared one.<\/p>\n<h2>Types of Variables in VBA<\/h2>\n<p>Variables in VBA occupy different amounts of memory based on their type. Here are some common types of variables:<\/p>\n<table>\n<thead>\n<tr>\n<th>Variable Type<\/th>\n<th>Name in VBA<\/th>\n<th>Memory Size (bytes)<\/th>\n<th>Value Range<\/th>\n<th>Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Boolean<\/td>\n<td>Boolean<\/td>\n<td>2<\/td>\n<td>True or False<\/td>\n<td>Answer = True<\/td>\n<\/tr>\n<tr>\n<td>Integer<\/td>\n<td>Integer<\/td>\n<td>2<\/td>\n<td>-32,768 &#x2194; 32,767<\/td>\n<td>Cant = 5<\/td>\n<\/tr>\n<tr>\n<td>Double Precision<\/td>\n<td>Double<\/td>\n<td>8<\/td>\n<td>\u00b11.79769313486232 \u00d7 10^308<\/td>\n<td>Pi = 3.14159265<\/td>\n<\/tr>\n<tr>\n<td>Currency<\/td>\n<td>Currency<\/td>\n<td>8<\/td>\n<td>-922,337,203,685,477 &#x2194; 922,337,203,685,477<\/td>\n<td>Amount = 5.5<\/td>\n<\/tr>\n<tr>\n<td>String<\/td>\n<td>String<\/td>\n<td>1 per character<\/td>\n<td>Any text<\/td>\n<td>Prod = \u00abCar\u00bb<\/td>\n<\/tr>\n<tr>\n<td>Variant<\/td>\n<td>Variant<\/td>\n<td>Varies<\/td>\n<td>Varies based on data type<\/td>\n<td>Total = Pi * Cant<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>VBA automatically assigns the <em>Variant<\/em> type to undeclared variables. It is advisable to declare the variable type to optimize memory usage and enhance performance.<\/p>\n<h2>Levels of Variables in VBA<\/h2>\n<p>In VBA, variables can be <strong>public<\/strong> (Public) or <strong>private<\/strong> (Private), depending on their accessibility level:<\/p>\n<table>\n<thead>\n<tr>\n<th>Variable Type<\/th>\n<th>Used in<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Private<\/td>\n<td>A single procedure (routine or function) within the same module<\/td>\n<\/tr>\n<tr>\n<td>Public<\/td>\n<td>All procedures across all modules<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Private variables can have the same name in different procedures since they are not shared. In contrast, public variables maintain their value while the macro is running.<\/p>\n<h2>How to Declare a Variable in VBA?<\/h2>\n<p>To declare a variable, follow these steps:<\/p>\n<ol>\n<li>Open the VBA command editor (you can refer to our <a href=\"https:\/\/smartcodebuilders.com\/wp\/en\/my-first-macro\/\">first tutorial on macros in Excel<\/a>).<\/li>\n<li>Use the <code>Dim<\/code> statement to declare the variable.<\/li>\n<\/ol>\n<p><strong>Example of Declaration:<\/strong><\/p>\n<pre><code>Dim pi As Double<\/code><\/pre>\n<p>In this case, we are reserving space for the variable <code>pi<\/code>, which will hold a double precision number.<\/p>\n<p><strong>Display the Result:<\/strong> To print the value, use <code>MsgBox<\/code>:<\/p>\n<pre><code>MsgBox(pi)<\/code><\/pre>\n<h2>Tips for Using Variables in VBA<\/h2>\n<ul>\n<li>To require VBA to always declare variables, use <code>Option Explicit<\/code> at the beginning of any module. This helps you avoid declaration errors.<\/li>\n<li>If you forget to declare a variable, VBA will highlight the error, making it easy to identify and correct.<\/li>\n<li>Use the <strong>CTRL + Space<\/strong> combination to access a menu of declared variables when typing.<\/li>\n<\/ul>\n<h2>About Variable Names in VBA<\/h2>\n<p>Choose descriptive names for your variables, as this facilitates code understanding. Here are some rules to follow:<\/p>\n<ul>\n<li>The first character must always be a letter.<\/li>\n<li>VBA is case-insensitive; <code>Var<\/code> and <code>var<\/code> refer to the same variable.<\/li>\n<li>Spaces and certain symbols are not allowed in names.<\/li>\n<li>The maximum number of characters for a variable name is 255.<\/li>\n<\/ul>\n<p>Want to know more?\u00a0<a href=\"https:\/\/smartcodebuilders.com\/wp\/en\/contact-us-2\/\">Contact us\u2026<\/a><\/p>\n<p>&nbsp;<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>What Are Variables in VBA and Why Are They Used? Variables are fundamental elements in any programming language, including VBA. They allow you to store and manipulate data, such as numbers, text, and more complex structures. By declaring variables properly,<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[98,100,96],"tags":[],"class_list":["post-1629","post","type-post","status-publish","format-standard","hentry","category-excel-en","category-learn-to-code","category-vba-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u25b7Complete Guide to Variables in VBA: Learn to Declare and Use Them - SmartCode Builders<\/title>\n<meta name=\"description\" content=\"What Are Variables in VBA and Why Are They Used? Variables are fundamental elements in any programming language, including VBA. They allow you to store\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u25b7Complete Guide to Variables in VBA: Learn to Declare and Use Them - SmartCode Builders\" \/>\n<meta property=\"og:description\" content=\"What Are Variables in VBA and Why Are They Used? Variables are fundamental elements in any programming language, including VBA. They allow you to store\" \/>\n<meta property=\"og:url\" content=\"https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/\" \/>\n<meta property=\"og:site_name\" content=\"SmartCode Builders\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-18T16:31:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-18T16:38:32+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/smartcodebuilders.com\/wp\/wp-content\/uploads\/2019\/10\/Fig-1-Por-que-declarar-variables-Sin-editar.jpg\" \/>\n<meta name=\"author\" content=\"SmartCoder1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"SmartCoder1\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/en\\\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/en\\\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\\\/\"},\"author\":{\"name\":\"SmartCoder1\",\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/#\\\/schema\\\/person\\\/69eae8c52989c036ac530e98038bd425\"},\"headline\":\"Complete Guide to Variables in VBA: Learn to Declare and Use Them\",\"datePublished\":\"2024-10-18T16:31:37+00:00\",\"dateModified\":\"2024-10-18T16:38:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/en\\\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\\\/\"},\"wordCount\":532,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/en\\\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/smartcodebuilders.com\\\/wp\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/Fig-1-Por-que-declarar-variables-Sin-editar.jpg\",\"articleSection\":[\"Excel\",\"Learn to Code\",\"VBA\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/en\\\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/en\\\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\\\/\",\"url\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/en\\\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\\\/\",\"name\":\"\u25b7Complete Guide to Variables in VBA: Learn to Declare and Use Them - SmartCode Builders\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/en\\\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/en\\\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/smartcodebuilders.com\\\/wp\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/Fig-1-Por-que-declarar-variables-Sin-editar.jpg\",\"datePublished\":\"2024-10-18T16:31:37+00:00\",\"dateModified\":\"2024-10-18T16:38:32+00:00\",\"description\":\"What Are Variables in VBA and Why Are They Used? Variables are fundamental elements in any programming language, including VBA. They allow you to store\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/en\\\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\\\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/en\\\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/en\\\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\\\/#primaryimage\",\"url\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/Fig-1-Por-que-declarar-variables-Sin-editar.jpg\",\"contentUrl\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/Fig-1-Por-que-declarar-variables-Sin-editar.jpg\",\"width\":646,\"height\":480},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/en\\\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Complete Guide to Variables in VBA: Learn to Declare and Use Them\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/#website\",\"url\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/\",\"name\":\"SmartCode Builders\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/#organization\",\"name\":\"SmartCode Builders\",\"url\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/cropped-SMARTCODE-LOGO-1-e1562625920666.png\",\"contentUrl\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/cropped-SMARTCODE-LOGO-1-e1562625920666.png\",\"width\":218,\"height\":76,\"caption\":\"SmartCode Builders\"},\"image\":{\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/smartcodebuilders.com\\\/wp\\\/#\\\/schema\\\/person\\\/69eae8c52989c036ac530e98038bd425\",\"name\":\"SmartCoder1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fbc4fa44515a73c95229807789bede85aa3d207915bc9bb7eda9146d2b68cd92?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fbc4fa44515a73c95229807789bede85aa3d207915bc9bb7eda9146d2b68cd92?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fbc4fa44515a73c95229807789bede85aa3d207915bc9bb7eda9146d2b68cd92?s=96&d=mm&r=g\",\"caption\":\"SmartCoder1\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u25b7Complete Guide to Variables in VBA: Learn to Declare and Use Them - SmartCode Builders","description":"What Are Variables in VBA and Why Are They Used? Variables are fundamental elements in any programming language, including VBA. They allow you to store","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:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/","og_locale":"es_ES","og_type":"article","og_title":"\u25b7Complete Guide to Variables in VBA: Learn to Declare and Use Them - SmartCode Builders","og_description":"What Are Variables in VBA and Why Are They Used? Variables are fundamental elements in any programming language, including VBA. They allow you to store","og_url":"https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/","og_site_name":"SmartCode Builders","article_published_time":"2024-10-18T16:31:37+00:00","article_modified_time":"2024-10-18T16:38:32+00:00","og_image":[{"url":"http:\/\/smartcodebuilders.com\/wp\/wp-content\/uploads\/2019\/10\/Fig-1-Por-que-declarar-variables-Sin-editar.jpg","type":"","width":"","height":""}],"author":"SmartCoder1","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"SmartCoder1","Tiempo de lectura":"3 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/#article","isPartOf":{"@id":"https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/"},"author":{"name":"SmartCoder1","@id":"https:\/\/smartcodebuilders.com\/wp\/#\/schema\/person\/69eae8c52989c036ac530e98038bd425"},"headline":"Complete Guide to Variables in VBA: Learn to Declare and Use Them","datePublished":"2024-10-18T16:31:37+00:00","dateModified":"2024-10-18T16:38:32+00:00","mainEntityOfPage":{"@id":"https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/"},"wordCount":532,"commentCount":0,"publisher":{"@id":"https:\/\/smartcodebuilders.com\/wp\/#organization"},"image":{"@id":"https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/#primaryimage"},"thumbnailUrl":"http:\/\/smartcodebuilders.com\/wp\/wp-content\/uploads\/2019\/10\/Fig-1-Por-que-declarar-variables-Sin-editar.jpg","articleSection":["Excel","Learn to Code","VBA"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/","url":"https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/","name":"\u25b7Complete Guide to Variables in VBA: Learn to Declare and Use Them - SmartCode Builders","isPartOf":{"@id":"https:\/\/smartcodebuilders.com\/wp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/#primaryimage"},"image":{"@id":"https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/#primaryimage"},"thumbnailUrl":"http:\/\/smartcodebuilders.com\/wp\/wp-content\/uploads\/2019\/10\/Fig-1-Por-que-declarar-variables-Sin-editar.jpg","datePublished":"2024-10-18T16:31:37+00:00","dateModified":"2024-10-18T16:38:32+00:00","description":"What Are Variables in VBA and Why Are They Used? Variables are fundamental elements in any programming language, including VBA. They allow you to store","breadcrumb":{"@id":"https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/#primaryimage","url":"https:\/\/smartcodebuilders.com\/wp\/wp-content\/uploads\/2019\/10\/Fig-1-Por-que-declarar-variables-Sin-editar.jpg","contentUrl":"https:\/\/smartcodebuilders.com\/wp\/wp-content\/uploads\/2019\/10\/Fig-1-Por-que-declarar-variables-Sin-editar.jpg","width":646,"height":480},{"@type":"BreadcrumbList","@id":"https:\/\/smartcodebuilders.com\/wp\/en\/complete-guide-to-variables-in-vba-learn-to-declare-and-use-them\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/smartcodebuilders.com\/wp\/"},{"@type":"ListItem","position":2,"name":"Complete Guide to Variables in VBA: Learn to Declare and Use Them"}]},{"@type":"WebSite","@id":"https:\/\/smartcodebuilders.com\/wp\/#website","url":"https:\/\/smartcodebuilders.com\/wp\/","name":"SmartCode Builders","description":"","publisher":{"@id":"https:\/\/smartcodebuilders.com\/wp\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/smartcodebuilders.com\/wp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/smartcodebuilders.com\/wp\/#organization","name":"SmartCode Builders","url":"https:\/\/smartcodebuilders.com\/wp\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/smartcodebuilders.com\/wp\/#\/schema\/logo\/image\/","url":"https:\/\/smartcodebuilders.com\/wp\/wp-content\/uploads\/2019\/07\/cropped-SMARTCODE-LOGO-1-e1562625920666.png","contentUrl":"https:\/\/smartcodebuilders.com\/wp\/wp-content\/uploads\/2019\/07\/cropped-SMARTCODE-LOGO-1-e1562625920666.png","width":218,"height":76,"caption":"SmartCode Builders"},"image":{"@id":"https:\/\/smartcodebuilders.com\/wp\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/smartcodebuilders.com\/wp\/#\/schema\/person\/69eae8c52989c036ac530e98038bd425","name":"SmartCoder1","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/secure.gravatar.com\/avatar\/fbc4fa44515a73c95229807789bede85aa3d207915bc9bb7eda9146d2b68cd92?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/fbc4fa44515a73c95229807789bede85aa3d207915bc9bb7eda9146d2b68cd92?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fbc4fa44515a73c95229807789bede85aa3d207915bc9bb7eda9146d2b68cd92?s=96&d=mm&r=g","caption":"SmartCoder1"}}]}},"_links":{"self":[{"href":"https:\/\/smartcodebuilders.com\/wp\/wp-json\/wp\/v2\/posts\/1629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smartcodebuilders.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smartcodebuilders.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smartcodebuilders.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/smartcodebuilders.com\/wp\/wp-json\/wp\/v2\/comments?post=1629"}],"version-history":[{"count":2,"href":"https:\/\/smartcodebuilders.com\/wp\/wp-json\/wp\/v2\/posts\/1629\/revisions"}],"predecessor-version":[{"id":1633,"href":"https:\/\/smartcodebuilders.com\/wp\/wp-json\/wp\/v2\/posts\/1629\/revisions\/1633"}],"wp:attachment":[{"href":"https:\/\/smartcodebuilders.com\/wp\/wp-json\/wp\/v2\/media?parent=1629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smartcodebuilders.com\/wp\/wp-json\/wp\/v2\/categories?post=1629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smartcodebuilders.com\/wp\/wp-json\/wp\/v2\/tags?post=1629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}