{"id":54,"date":"2020-01-28T12:21:54","date_gmt":"2020-01-28T11:21:54","guid":{"rendered":"https:\/\/codedoneright.eu\/?page_id=54"},"modified":"2020-03-07T20:25:50","modified_gmt":"2020-03-07T19:25:50","slug":"cell-text-cleaning","status":"publish","type":"page","link":"https:\/\/codedoneright.eu\/?page_id=54","title":{"rendered":"Cell text cleaning"},"content":{"rendered":"\n<p>This procedure is changing the contents of the cell to be displayed in sentence case, additionally it removes any leading and trailing spaces as well as any multiple spaces between words. It is useful if you import\/paste data to MS Excel that needs a client facing look. Nobody likes ALL CAPS look. Nobody.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Sub CellTextCleaning()\n    Dim CellValue As String\n    Dim CellLen As Integer\n    Dim CellRest As String\n\n    Selection.NumberFormat = \"@\"            'Changes the cell type to text\n    ActiveCell.Value = Application.WorksheetFunction.Trim(ActiveCell.Value) 'Removes any leading, trailing and multiple spaces\n    ActiveCell.Value = LCase(ActiveCell.Value)  'Sets lowercase for the whole string\n    \n    CellValue = ActiveCell.Value            'Loads active cell's contents to CellValue\n    CellLen = Len(CellValue)                'Counts number of characters\n    CellRest = Mid(CellValue, 2, CellLen)   'Loads active cell's contents to CellRest starting from 2nd char\n\n    CellValue = Mid(CellValue, 1, 1)        'Loads active cell's first character\n    CellValue = UCase(CellValue)            'Capitalises the string\n\n    ActiveCell.Value = CellValue &amp; CellRest 'Joins capitalised string CellValue with CellRest to produce the end result\nEnd Sub<\/code><\/pre>\n\n\n\n\n<div id=\"wpfp_c9f287e89b63f5997441c3d1adae4389\" data-item=\"{&quot;sources&quot;:[{&quot;src&quot;:&quot;https:\\\/\\\/codedoneright.eu:443\\\/video\\\/CTC.mp4&quot;,&quot;type&quot;:&quot;video\\\/mp4&quot;}]}\" class=\"flowplayer no-brand is-splash is-paused skin-slim no-svg fp-slim fp-edgy\" style=\"position:relative; max-width: 640px; max-height: 360px; \" data-ratio=\"0.5625\" data-advance=\"false\">\n\t<div class=\"fp-ratio\" style=\"padding-top: 56.25%\"><\/div>\n\t<div class=\"fp-ui\"><noscript>Please enable JavaScript<\/noscript><div class=\"fp-play fp-visible\"><svg class=\"fp-play-sharp-fill\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 100 100\"><defs><style>.fp-color-play{opacity:0.65;}.controlbutton{fill:#fff;}<\/style><\/defs><title>play-sharp-fill<\/title><path class=\"fp-color-play\" d=\"M49.9217-.078a50,50,0,1,0,50,50A50.0564,50.0564,0,0,0,49.9217-.078Z\"\/><polygon class=\"controlbutton\" points=\"73.601 50 37.968 70.573 37.968 29.427 73.601 50\" filter=\"url(#f1)\"\/><\/svg><\/div><div class=\"fp-preload\"><b><\/b><b><\/b><b><\/b><b><\/b><\/div><\/div>\n\n<\/div>\n\n\n\n\n\n<p>Above video depicts the use of the procedure<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This procedure is changing the contents of the cell to be displayed in sentence case, additionally it removes any leading and trailing spaces as well as any multiple spaces between words. It is useful if you import\/paste data to MS&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":34,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Cell text cleaning &#8212; Code Done Right!<\/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:\/\/codedoneright.eu\/?page_id=54\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Cell text cleaning &#8212; Code Done Right!\" \/>\n<meta name=\"twitter:description\" content=\"This procedure is changing the contents of the cell to be displayed in sentence case, additionally it removes any leading and trailing spaces as well as any multiple spaces between words. It is useful if you import\/paste data to MS&hellip;\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codedoneright.eu\/?page_id=54\",\"url\":\"https:\/\/codedoneright.eu\/?page_id=54\",\"name\":\"Cell text cleaning &#8212; Code Done Right!\",\"isPartOf\":{\"@id\":\"https:\/\/codedoneright.eu\/#website\"},\"datePublished\":\"2020-01-28T11:21:54+00:00\",\"dateModified\":\"2020-03-07T19:25:50+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/codedoneright.eu\/?page_id=54#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codedoneright.eu\/?page_id=54\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codedoneright.eu\/?page_id=54#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codedoneright.eu\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VBA\",\"item\":\"https:\/\/codedoneright.eu\/?page_id=34\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Cell text cleaning\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codedoneright.eu\/#website\",\"url\":\"https:\/\/codedoneright.eu\/\",\"name\":\"Code Done Right!\",\"description\":\"Raspberry Pi server guides\",\"publisher\":{\"@id\":\"https:\/\/codedoneright.eu\/#\/schema\/person\/50378701e349dbd5d40888bc5b532568\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codedoneright.eu\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/codedoneright.eu\/#\/schema\/person\/50378701e349dbd5d40888bc5b532568\",\"name\":\"CodeDoneRight\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codedoneright.eu\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/codedoneright.eu\/wp-content\/uploads\/www_icon.png\",\"contentUrl\":\"https:\/\/codedoneright.eu\/wp-content\/uploads\/www_icon.png\",\"width\":120,\"height\":120,\"caption\":\"CodeDoneRight\"},\"logo\":{\"@id\":\"https:\/\/codedoneright.eu\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/codedoneright.eu\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cell text cleaning &#8212; Code Done Right!","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:\/\/codedoneright.eu\/?page_id=54","twitter_card":"summary_large_image","twitter_title":"Cell text cleaning &#8212; Code Done Right!","twitter_description":"This procedure is changing the contents of the cell to be displayed in sentence case, additionally it removes any leading and trailing spaces as well as any multiple spaces between words. It is useful if you import\/paste data to MS&hellip;","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/codedoneright.eu\/?page_id=54","url":"https:\/\/codedoneright.eu\/?page_id=54","name":"Cell text cleaning &#8212; Code Done Right!","isPartOf":{"@id":"https:\/\/codedoneright.eu\/#website"},"datePublished":"2020-01-28T11:21:54+00:00","dateModified":"2020-03-07T19:25:50+00:00","breadcrumb":{"@id":"https:\/\/codedoneright.eu\/?page_id=54#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codedoneright.eu\/?page_id=54"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/codedoneright.eu\/?page_id=54#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codedoneright.eu\/"},{"@type":"ListItem","position":2,"name":"VBA","item":"https:\/\/codedoneright.eu\/?page_id=34"},{"@type":"ListItem","position":3,"name":"Cell text cleaning"}]},{"@type":"WebSite","@id":"https:\/\/codedoneright.eu\/#website","url":"https:\/\/codedoneright.eu\/","name":"Code Done Right!","description":"Raspberry Pi server guides","publisher":{"@id":"https:\/\/codedoneright.eu\/#\/schema\/person\/50378701e349dbd5d40888bc5b532568"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codedoneright.eu\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/codedoneright.eu\/#\/schema\/person\/50378701e349dbd5d40888bc5b532568","name":"CodeDoneRight","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codedoneright.eu\/#\/schema\/person\/image\/","url":"https:\/\/codedoneright.eu\/wp-content\/uploads\/www_icon.png","contentUrl":"https:\/\/codedoneright.eu\/wp-content\/uploads\/www_icon.png","width":120,"height":120,"caption":"CodeDoneRight"},"logo":{"@id":"https:\/\/codedoneright.eu\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/codedoneright.eu"]}]}},"_links":{"self":[{"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/pages\/54"}],"collection":[{"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codedoneright.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=54"}],"version-history":[{"count":4,"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/pages\/54\/revisions"}],"predecessor-version":[{"id":60,"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/pages\/54\/revisions\/60"}],"up":[{"embeddable":true,"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/pages\/34"}],"wp:attachment":[{"href":"https:\/\/codedoneright.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}