{"id":500,"date":"2018-06-28T11:30:11","date_gmt":"2018-06-28T11:30:11","guid":{"rendered":"http:\/\/officetuts.net\/excel\/?p=500"},"modified":"2024-03-29T15:55:39","modified_gmt":"2024-03-29T15:55:39","slug":"chr-34","status":"publish","type":"post","link":"https:\/\/officetuts.net\/excel\/vba\/chr-34\/","title":{"rendered":"Chr 34 in VBA"},"content":{"rendered":"\n

CHR<\/strong> is the VBA function and returns the character from the ASCII table.<\/p>\n\n\n\n

For example, Chr(34)<\/strong> returns the 34th character, which is the \u201c sign (double quotes).<\/p>\n\n\n\n

Example:<\/h3>\n\n\n\n

Look at this example. Let\u2019s say that you want to insert the following name into the cell using the VBA<\/strong> code.<\/p>\n\n\n\n

Edwin \u201cBuzz\u201d Aldrin<\/strong><\/p>\n\n\n\n

You can use one of the two methods.<\/p>\n\n\n\n

    \n
  1. \u201cEdwin \u201c\u201dBuzz\u201d\u201d Aldrin\u201d<\/li>\n\n\n\n
  2. \u201cEdwin \u201c & chr(34) & \u201cBuzz\u201d & chr(34) & \u201c Aldrin\u201c<\/li>\n<\/ol>\n\n\n\n

    To illustrate how you can Execute the following macro inside a cell, use this formula.<\/p>\n\n\n\n

    Sub InsertText()\n   ActiveCell.Value = \"Edwin \" & Chr(34) & \"Buzz\" & Chr(34) & \" Aldrin\"\nEnd Sub<\/pre>\n\n\n\n

    Both examples will display the name in double quotes.<\/p>\n\n\n\n

    \"\"<\/figure>\n\n\n\n

    CAUTION<\/h3>\n\n\n\n

    Don\u2019t confuse the chr<\/strong> function with the CHAR<\/strong> function. The first one is used in VBA, and the second one is in Excel.<\/p>\n","protected":false},"excerpt":{"rendered":"

    CHR is the VBA function and returns the character from the ASCII table. For example, Chr(34) returns the 34th character, which is the \u201c sign (double…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[190],"yoast_head":"\nChr 34 in VBA<\/title>\n<meta name=\"description\" content=\"Learn how to use VBA Function, Chr, to return the character from the ASCII table. Check out an example of how to use it to add quotes in a cell.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/officetuts.net\/excel\/vba\/chr-34\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Chr 34 in VBA\" \/>\n<meta property=\"og:description\" content=\"Learn how to use VBA Function, Chr, to return the character from the ASCII table. Check out an example of how to use it to add quotes in a cell.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/officetuts.net\/excel\/vba\/chr-34\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-28T11:30:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-29T15:55:39+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/06\/example-3.png\" \/>\n<meta name=\"author\" content=\"Tomasz Decker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tomasz Decker\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/officetuts.net\/excel\/vba\/chr-34\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/vba\/chr-34\/\"},\"author\":{\"name\":\"Tomasz Decker\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"headline\":\"Chr 34 in VBA\",\"datePublished\":\"2018-06-28T11:30:11+00:00\",\"dateModified\":\"2024-03-29T15:55:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/vba\/chr-34\/\"},\"wordCount\":133,\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/vba\/chr-34\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/06\/example-3.png\",\"keywords\":[\"pinterest\"],\"articleSection\":[\"vba\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/officetuts.net\/excel\/vba\/chr-34\/\",\"url\":\"https:\/\/officetuts.net\/excel\/vba\/chr-34\/\",\"name\":\"Chr 34 in VBA\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/vba\/chr-34\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/vba\/chr-34\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/06\/example-3.png\",\"datePublished\":\"2018-06-28T11:30:11+00:00\",\"dateModified\":\"2024-03-29T15:55:39+00:00\",\"description\":\"Learn how to use VBA Function, Chr, to return the character from the ASCII table. Check out an example of how to use it to add quotes in a cell.\",\"breadcrumb\":{\"@id\":\"https:\/\/officetuts.net\/excel\/vba\/chr-34\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/officetuts.net\/excel\/vba\/chr-34\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/vba\/chr-34\/#primaryimage\",\"url\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/06\/example-3.png\",\"contentUrl\":\"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/06\/example-3.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/officetuts.net\/excel\/vba\/chr-34\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/officetuts.net\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Chr 34 in VBA\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/officetuts.net\/excel\/#website\",\"url\":\"https:\/\/officetuts.net\/excel\/\",\"name\":\"\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/officetuts.net\/excel\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\",\"name\":\"Tomasz Decker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"caption\":\"Tomasz Decker\"},\"logo\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\"},\"description\":\"Spreadsheet and Python enthusiast.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Chr 34 in VBA","description":"Learn how to use VBA Function, Chr, to return the character from the ASCII table. Check out an example of how to use it to add quotes in a cell.","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:\/\/officetuts.net\/excel\/vba\/chr-34\/","og_locale":"en_US","og_type":"article","og_title":"Chr 34 in VBA","og_description":"Learn how to use VBA Function, Chr, to return the character from the ASCII table. Check out an example of how to use it to add quotes in a cell.","og_url":"https:\/\/officetuts.net\/excel\/vba\/chr-34\/","article_published_time":"2018-06-28T11:30:11+00:00","article_modified_time":"2024-03-29T15:55:39+00:00","og_image":[{"url":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/06\/example-3.png"}],"author":"Tomasz Decker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tomasz Decker","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/officetuts.net\/excel\/vba\/chr-34\/#article","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/vba\/chr-34\/"},"author":{"name":"Tomasz Decker","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"headline":"Chr 34 in VBA","datePublished":"2018-06-28T11:30:11+00:00","dateModified":"2024-03-29T15:55:39+00:00","mainEntityOfPage":{"@id":"https:\/\/officetuts.net\/excel\/vba\/chr-34\/"},"wordCount":133,"publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"image":{"@id":"https:\/\/officetuts.net\/excel\/vba\/chr-34\/#primaryimage"},"thumbnailUrl":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/06\/example-3.png","keywords":["pinterest"],"articleSection":["vba"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/officetuts.net\/excel\/vba\/chr-34\/","url":"https:\/\/officetuts.net\/excel\/vba\/chr-34\/","name":"Chr 34 in VBA","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/officetuts.net\/excel\/vba\/chr-34\/#primaryimage"},"image":{"@id":"https:\/\/officetuts.net\/excel\/vba\/chr-34\/#primaryimage"},"thumbnailUrl":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/06\/example-3.png","datePublished":"2018-06-28T11:30:11+00:00","dateModified":"2024-03-29T15:55:39+00:00","description":"Learn how to use VBA Function, Chr, to return the character from the ASCII table. Check out an example of how to use it to add quotes in a cell.","breadcrumb":{"@id":"https:\/\/officetuts.net\/excel\/vba\/chr-34\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/officetuts.net\/excel\/vba\/chr-34\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/vba\/chr-34\/#primaryimage","url":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/06\/example-3.png","contentUrl":"http:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2018\/06\/example-3.png"},{"@type":"BreadcrumbList","@id":"https:\/\/officetuts.net\/excel\/vba\/chr-34\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/officetuts.net\/excel\/"},{"@type":"ListItem","position":2,"name":"Chr 34 in VBA"}]},{"@type":"WebSite","@id":"https:\/\/officetuts.net\/excel\/#website","url":"https:\/\/officetuts.net\/excel\/","name":"","description":"","publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/officetuts.net\/excel\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42","name":"Tomasz Decker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","caption":"Tomasz Decker"},"logo":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/"},"description":"Spreadsheet and Python enthusiast."}]}},"_links":{"self":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/500"}],"collection":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/comments?post=500"}],"version-history":[{"count":4,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/500\/revisions"}],"predecessor-version":[{"id":17399,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/500\/revisions\/17399"}],"wp:attachment":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/media?parent=500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/categories?post=500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/tags?post=500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}