{"id":271,"date":"2011-07-18T14:21:00","date_gmt":"2011-07-18T18:21:00","guid":{"rendered":"http:\/\/debradalgleish.com\/blog\/?p=271"},"modified":"2011-07-18T17:29:40","modified_gmt":"2011-07-18T21:29:40","slug":"format-vba-code-examples-in-blog-post","status":"publish","type":"post","link":"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/","title":{"rendered":"Format VBA Code Examples in Blog Post"},"content":{"rendered":"<p>On the Contextures blog, Gregory suggested using the WordPress plugin, <a title=\"CodeColorer\" href=\"http:\/\/kpumuk.info\/projects\/wordpress-plugins\/codecolorer\/\" target=\"_blank\">CodeColorer<\/a>, for formatting the Excel VBA code examples.<\/p>\n<p>In Twitter, Dick Kusleika said that he\u2019s <a title=\"using CodeColorer\" href=\"http:\/\/www.dailydoseofexcel.com\/archives\/2009\/11\/17\/codecolorer\/\" target=\"_blank\">using CodeColorer<\/a> too, and it works well. I decided to test the plug-in here, before installing it on the Contextures blog.<\/p>\n<p>The CodeColorer feature list looks promising, especially these items:<\/p>\n<ul>\n<li>syntax highlighting of code in comments<\/li>\n<li>code protect from mangling by WordPress (for example, quotes, double-dashes, etc would look just right as you entered)<\/li>\n<\/ul>\n<h3>Installing the CodeColorer Plugin<\/h3>\n<p>The installation was quick and easy, using the WordPress dashboard. After activating the plugin, I went to the its settings page, to see what could be adjusted. What\u2019s the fun in having a new toy, if you don\u2019t try to break it?<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border: 0px;\" title=\"CodeColorer01\" src=\"http:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer01.png\" alt=\"CodeColorer01\" width=\"496\" height=\"499\" border=\"0\" \/><\/p>\n<p>There is a preview of the code, at the bottom of the settings panel. I changed the Theme, from the default of Slush and Poppies(!) to Vibrant Ink. The preview only changed after I clicked the Save Options button.<\/p>\n<p>Yikes! That\u2019s not the look I\u2019m going for.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border: 0px;\" title=\"CodeColorer02\" src=\"http:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer02.png\" alt=\"CodeColorer02\" width=\"454\" height=\"179\" border=\"0\" \/><\/p>\n<p>Twitlight (yes, TwiTlight), looked about the same. At the other end of the code formatting scale, Dawn is a bit too subtle.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border: 0px;\" title=\"CodeColorer03\" src=\"http:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer03.png\" alt=\"CodeColorer03\" width=\"451\" height=\"176\" border=\"0\" \/><\/p>\n<p>So, back to Slush and Poppies it is. Is it just me, or would Slush and Puppies be a better name?<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border: 0px;\" title=\"CodeColorer04\" src=\"http:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer04.png\" alt=\"CodeColorer04\" width=\"452\" height=\"175\" border=\"0\" \/><\/p>\n<h3>The Formatted Code<\/h3>\n<p>Here\u2019s the snippet of code that I copied from Excel VBA.<\/p>\n<p><code lang=\"vb\">Sub DeleteCustomLists()<br \/>\n' built in lists are not deleted<br \/>\nDim n As Long<\/p>\n<p>n = Application.CustomListCount<br \/>\nOn Error Resume Next<br \/>\nFor n = n To 1 Step -1<br \/>\nApplication.DeleteCustomList ListNum:=n<br \/>\nNext n<br \/>\nEnd Sub<\/code><\/p>\n<p>And this is how it looked in Excel<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border: 0px;\" title=\"CodeColorer05\" src=\"http:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer05.png\" alt=\"CodeColorer05\" width=\"358\" height=\"184\" border=\"0\" \/><\/p>\n<h3>Formatted Code in Comments<\/h3>\n<p>The CodeColorer plugin is supposed to format the code in the comments too. You can test it here, and please let me know if you have any trouble, or suggestions.<\/p>\n<p>To format your code in the comments, use this syntax:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border: 0px;\" title=\"CodeColorer06\" src=\"http:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer06.png\" alt=\"CodeColorer06\" width=\"337\" height=\"53\" border=\"0\" \/><\/p>\n<p>Thanks!<\/p>\n<p>______________<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On the Contextures blog, Gregory suggested using the WordPress plugin, CodeColorer, for formatting the Excel VBA code examples. In Twitter, Dick Kusleika said that he\u2019s using CodeColorer too, and it works well. I decided to test the plug-in here, before installing it on the Contextures blog. The CodeColorer feature list looks promising, especially these items: &hellip; <a href=\"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Format VBA Code Examples in Blog Post&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-271","post","type-post","status-publish","format-standard","hentry","category-excel-blog"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Format VBA Code Examples in Blog Post - Debra D&#039;s Blog<\/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:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Format VBA Code Examples in Blog Post - Debra D&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"On the Contextures blog, Gregory suggested using the WordPress plugin, CodeColorer, for formatting the Excel VBA code examples. In Twitter, Dick Kusleika said that he\u2019s using CodeColorer too, and it works well. I decided to test the plug-in here, before installing it on the Contextures blog. The CodeColorer feature list looks promising, especially these items: &hellip; Continue reading &quot;Format VBA Code Examples in Blog Post&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/\" \/>\n<meta property=\"og:site_name\" content=\"Debra D&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2011-07-18T18:21:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2011-07-18T21:29:40+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer01.png\" \/>\n<meta name=\"author\" content=\"Debra Dalgleish\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Debra Dalgleish\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\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:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/\"},\"author\":{\"name\":\"Debra Dalgleish\",\"@id\":\"https:\/\/debradalgleish.com\/blog\/#\/schema\/person\/fc3f038bcaeda478f9c5c06cfe648735\"},\"headline\":\"Format VBA Code Examples in Blog Post\",\"datePublished\":\"2011-07-18T18:21:00+00:00\",\"dateModified\":\"2011-07-18T21:29:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/\"},\"wordCount\":295,\"commentCount\":4,\"image\":{\"@id\":\"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer01.png\",\"articleSection\":[\"Excel blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/\",\"url\":\"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/\",\"name\":\"Format VBA Code Examples in Blog Post - Debra D&#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\/\/debradalgleish.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer01.png\",\"datePublished\":\"2011-07-18T18:21:00+00:00\",\"dateModified\":\"2011-07-18T21:29:40+00:00\",\"author\":{\"@id\":\"https:\/\/debradalgleish.com\/blog\/#\/schema\/person\/fc3f038bcaeda478f9c5c06cfe648735\"},\"breadcrumb\":{\"@id\":\"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#primaryimage\",\"url\":\"https:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer01.png\",\"contentUrl\":\"https:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer01.png\",\"width\":\"496\",\"height\":\"499\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/debradalgleish.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Format VBA Code Examples in Blog Post\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/debradalgleish.com\/blog\/#website\",\"url\":\"https:\/\/debradalgleish.com\/blog\/\",\"name\":\"Debra D&#039;s Blog\",\"description\":\"Behind the Scenes in My Online Business\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/debradalgleish.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/debradalgleish.com\/blog\/#\/schema\/person\/fc3f038bcaeda478f9c5c06cfe648735\",\"name\":\"Debra Dalgleish\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/debradalgleish.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4ce35cfcf6755fd46a43ba02263b28eeee3c46c5caac91f7ff18f31c817bb943?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4ce35cfcf6755fd46a43ba02263b28eeee3c46c5caac91f7ff18f31c817bb943?s=96&d=mm&r=g\",\"caption\":\"Debra Dalgleish\"},\"url\":\"https:\/\/debradalgleish.com\/blog\/author\/debra\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Format VBA Code Examples in Blog Post - Debra D&#039;s Blog","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:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/","og_locale":"en_US","og_type":"article","og_title":"Format VBA Code Examples in Blog Post - Debra D&#039;s Blog","og_description":"On the Contextures blog, Gregory suggested using the WordPress plugin, CodeColorer, for formatting the Excel VBA code examples. In Twitter, Dick Kusleika said that he\u2019s using CodeColorer too, and it works well. I decided to test the plug-in here, before installing it on the Contextures blog. The CodeColorer feature list looks promising, especially these items: &hellip; Continue reading \"Format VBA Code Examples in Blog Post\"","og_url":"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/","og_site_name":"Debra D&#039;s Blog","article_published_time":"2011-07-18T18:21:00+00:00","article_modified_time":"2011-07-18T21:29:40+00:00","og_image":[{"url":"http:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer01.png","type":"","width":"","height":""}],"author":"Debra Dalgleish","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Debra Dalgleish","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#article","isPartOf":{"@id":"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/"},"author":{"name":"Debra Dalgleish","@id":"https:\/\/debradalgleish.com\/blog\/#\/schema\/person\/fc3f038bcaeda478f9c5c06cfe648735"},"headline":"Format VBA Code Examples in Blog Post","datePublished":"2011-07-18T18:21:00+00:00","dateModified":"2011-07-18T21:29:40+00:00","mainEntityOfPage":{"@id":"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/"},"wordCount":295,"commentCount":4,"image":{"@id":"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#primaryimage"},"thumbnailUrl":"http:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer01.png","articleSection":["Excel blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/","url":"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/","name":"Format VBA Code Examples in Blog Post - Debra D&#039;s Blog","isPartOf":{"@id":"https:\/\/debradalgleish.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#primaryimage"},"image":{"@id":"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#primaryimage"},"thumbnailUrl":"http:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer01.png","datePublished":"2011-07-18T18:21:00+00:00","dateModified":"2011-07-18T21:29:40+00:00","author":{"@id":"https:\/\/debradalgleish.com\/blog\/#\/schema\/person\/fc3f038bcaeda478f9c5c06cfe648735"},"breadcrumb":{"@id":"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#primaryimage","url":"https:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer01.png","contentUrl":"https:\/\/debradalgleish.com\/blog\/wp-content\/uploads\/2011\/07\/CodeColorer01.png","width":"496","height":"499"},{"@type":"BreadcrumbList","@id":"https:\/\/debradalgleish.com\/blog\/2011\/07\/18\/format-vba-code-examples-in-blog-post\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/debradalgleish.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Format VBA Code Examples in Blog Post"}]},{"@type":"WebSite","@id":"https:\/\/debradalgleish.com\/blog\/#website","url":"https:\/\/debradalgleish.com\/blog\/","name":"Debra D&#039;s Blog","description":"Behind the Scenes in My Online Business","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/debradalgleish.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/debradalgleish.com\/blog\/#\/schema\/person\/fc3f038bcaeda478f9c5c06cfe648735","name":"Debra Dalgleish","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/debradalgleish.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4ce35cfcf6755fd46a43ba02263b28eeee3c46c5caac91f7ff18f31c817bb943?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4ce35cfcf6755fd46a43ba02263b28eeee3c46c5caac91f7ff18f31c817bb943?s=96&d=mm&r=g","caption":"Debra Dalgleish"},"url":"https:\/\/debradalgleish.com\/blog\/author\/debra\/"}]}},"_links":{"self":[{"href":"https:\/\/debradalgleish.com\/blog\/wp-json\/wp\/v2\/posts\/271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/debradalgleish.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/debradalgleish.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/debradalgleish.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/debradalgleish.com\/blog\/wp-json\/wp\/v2\/comments?post=271"}],"version-history":[{"count":16,"href":"https:\/\/debradalgleish.com\/blog\/wp-json\/wp\/v2\/posts\/271\/revisions"}],"predecessor-version":[{"id":288,"href":"https:\/\/debradalgleish.com\/blog\/wp-json\/wp\/v2\/posts\/271\/revisions\/288"}],"wp:attachment":[{"href":"https:\/\/debradalgleish.com\/blog\/wp-json\/wp\/v2\/media?parent=271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/debradalgleish.com\/blog\/wp-json\/wp\/v2\/categories?post=271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/debradalgleish.com\/blog\/wp-json\/wp\/v2\/tags?post=271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}