{"id":1169,"date":"2023-06-15T07:04:08","date_gmt":"2023-06-15T07:04:08","guid":{"rendered":"https:\/\/craftcookcode.com\/?p=1169"},"modified":"2024-07-10T02:05:52","modified_gmt":"2024-07-10T02:05:52","slug":"excel-vba-concatenating-two-fields-together-with-formatting","status":"publish","type":"post","link":"https:\/\/craftcookcode.com\/?p=1169","title":{"rendered":"Excel &#038; VBA &#8211; Concatenating two fields together with formatting"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n<p>A work colleague asked me to do a &#8220;Mate&#8217;s rate&#8221; job for his team yesterday.<\/p>\n<p>They had a MS Word document with a huge table in it that they needed to convert to Excel to load into an application.<\/p>\n<p>Paraphrased&nbsp; it looked like this:<\/p>\n<style>\/*! elementor - v3.13.3 - 28-05-2023 *\/<br \/>\n.elementor-widget-image{text-align:center}.elementor-widget-image a{display:inline-block}.elementor-widget-image a img[src$=\".svg\"]{width:48px}.elementor-widget-image img{vertical-align:middle;display:inline-block}<\/style>\n<p>\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"740\" height=\"245\" src=\"http:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_01-1024x339.png\" alt=\"\" loading=\"lazy\" srcset=\"https:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_01-1024x339.png 1024w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_01-300x99.png 300w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_01-768x254.png 768w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_01-1536x508.png 1536w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_01.png 1916w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\"><\/p>\n<p>My first thought was to copy this table out and paste it into excel to see how it looks:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"740\" height=\"387\" src=\"http:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_02-1024x535.png\" alt=\"\" loading=\"lazy\" srcset=\"https:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_02-1024x535.png 1024w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_02-300x157.png 300w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_02-768x401.png 768w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_02.png 1205w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\"><\/p>\n<p>Two problems:<\/p>\n<ol>\n<li>The cell &#8220;Some data&#8221; is merged across three rows<\/li>\n<li>Line 1, Line 2, Line 3 are now split across three rows instead of being in the one cell<\/li>\n<\/ol>\n<p>I wrote a macro to split out the merge cells; but when it came to combining cells for Line 1, Line 2 and Line 3 I ran into a problem.<\/p>\n<p>None of the usual commands and from my quick google searching could combine the cells and retained the formatting.<\/p>\n<p>So commands like:<\/p>\n<pre>=CONCAT(B2:B4)\n\n=B2 &amp; B3 &amp; B4<\/pre>\n<p>Would not retain the formatting; let alone add in line feed characters to make it a multiline cell<\/p>\n<p>I&#8217;m sure there is a better way &#8211; but strapped for time I programmed the following subroutine in VBA<\/p>\n<pre>Public Sub combineCells(cell1 As Range, cell2 As Range, output As Range)\n  &nbsp; Dim formatIndex As Long\n  &nbsp; Dim formatOffset As Long\n  &nbsp; Dim hyperlink1 As String\n&nbsp; &nbsp; Dim hyperlink2 As String\n\n    hyperlink1 = \"\"\n  &nbsp; hyperlink2 = \"\"\n\n&nbsp; &nbsp; ' Check if the cell has a hyperlin; but don't have a text version of the hyperlink in the Value 2\n  &nbsp; If cell1.Hyperlinks.Count &lt;&gt; 0 And InStr(cell1.Value2, \"https:\") &lt; 1 Then\n  &nbsp; &nbsp; &nbsp; hyperlink1 = \" [\" &amp; cell1.Hyperlinks(1).Address &amp; \"]\"\n  &nbsp; End If\n\n&nbsp; &nbsp; If cell2.Hyperlinks.Count &lt;&gt; 0 And InStr(cell2.Value2, \"https:\") &lt; 1 Then\n  &nbsp; &nbsp; &nbsp; hyperlink2 = \" [\" &amp; cell2.Hyperlinks(1).Address &amp; \"]\"\n  &nbsp; End If\n\n \n  &nbsp; ' Handling if the first cell is blank. &nbsp;If so we don't want a LF at the top of the cell\n  &nbsp; If Trim(cell1.Value2) &lt;&gt; \"\" Then\n  &nbsp; &nbsp; &nbsp; output.Value2 = cell1.Value2 &amp; hyperlink1 &amp; vbLf &amp; cell2.Value2 &amp; hyperlink2\n  &nbsp; &nbsp; &nbsp; formatOffset = Len(cell1.Value2) + Len(hyperlink1) + 1\n  &nbsp; Else\n  &nbsp; &nbsp; &nbsp; output.Value2 = cell2.Value2 &amp; hyperlink2\n  &nbsp; &nbsp; &nbsp; formatOffset = Len(cell1.Value2)\n&nbsp; &nbsp; End If\n\n  \n  &nbsp; ' Copies the formatting from cell1 to the final cell\n  &nbsp; ' You can add more options to transfer over different formatting\n  &nbsp; For formatIndex = 1 To Len(cell1.Value2)\n  &nbsp; &nbsp; &nbsp; output.Characters(formatIndex, 1).Font.Bold = cell1.Characters(formatIndex, 1).Font.Bold\n  &nbsp; &nbsp; &nbsp; output.Characters(formatIndex, 1).Font.Italic = cell1.Characters(formatIndex, 1).Font.Italic\n  &nbsp; &nbsp; &nbsp; 'output.Characters(formatIndex, 1).Font.Underline = cell1.Characters(formatIndex, 1).Font.Underline\n&nbsp; &nbsp; Next\n\n  \n  &nbsp; ' Copies the formatting from cell2 to the final cell\n  &nbsp; For formatIndex = 1 To Len(cell2.Value2)\n  &nbsp; &nbsp; &nbsp; output.Characters(formatIndex + formatOffset, 1).Font.Bold = cell2.Characters(formatIndex, 1).Font.Bold\n  &nbsp; &nbsp; &nbsp; output.Characters(formatIndex + formatOffset, 1).Font.Italic = cell2.Characters(formatIndex, 1).Font.Italic\n  &nbsp; &nbsp; &nbsp; 'output.Characters(formatIndex + formatOffset, 1).Font.Underline = cell2.Characters(formatIndex, 1).Font.Underline\n&nbsp; &nbsp; Next\n\nEnd Sub<\/pre>\n<p>Oh boy it runs slow &#8211; to combine a couple of thousands cells took half an hour and I had the typical worries that Excel crashed because everything was locked up.<\/p>\n<p>But it worked for the quick task that I was doing<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"740\" height=\"214\" src=\"http:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_03-1024x296.png\" alt=\"\" loading=\"lazy\" srcset=\"https:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_03-1024x296.png 1024w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_03-300x87.png 300w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_03-768x222.png 768w, https:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_03.png 1308w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\"><\/p>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A work colleague asked me to do a &#8220;Mate&#8217;s rate&#8221; job for his team yesterday. They had a MS Word document with a huge table in&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[52],"tags":[],"class_list":["post-1169","post","type-post","status-publish","format-standard","hentry","category-vba-vbs"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"A work colleague asked me to do a &quot;Mate&#039;s rate&quot; job for his team yesterday. They had a MS Word document with a huge table in it that they needed to convert to Excel to load into an application. Paraphrased it looked like this: My first thought was to copy this table out and paste\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"jonny.donker@gmail.com\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/craftcookcode.com\/?p=1169\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Craft Cook Code - c^3?\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Excel &amp; VBA \u2013 Concatenating two fields together with formatting - Craft Cook Code\" \/>\n\t\t<meta property=\"og:description\" content=\"A work colleague asked me to do a &quot;Mate&#039;s rate&quot; job for his team yesterday. They had a MS Word document with a huge table in it that they needed to convert to Excel to load into an application. Paraphrased it looked like this: My first thought was to copy this table out and paste\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/craftcookcode.com\/?p=1169\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2023-06-15T07:04:08+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-07-10T02:05:52+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Excel &amp; VBA \u2013 Concatenating two fields together with formatting - Craft Cook Code\" \/>\n\t\t<meta name=\"twitter:description\" content=\"A work colleague asked me to do a &quot;Mate&#039;s rate&quot; job for his team yesterday. They had a MS Word document with a huge table in it that they needed to convert to Excel to load into an application. Paraphrased it looked like this: My first thought was to copy this table out and paste\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=1169#blogposting\",\"name\":\"Excel & VBA \\u2013 Concatenating two fields together with formatting - Craft Cook Code\",\"headline\":\"Excel &#038; VBA &#8211; Concatenating two fields together with formatting\",\"author\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?author=1#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/craftcookcode.com\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/code_excel_concat_01.png\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=1169\\\/#articleImage\",\"width\":1916,\"height\":634},\"datePublished\":\"2023-06-15T07:04:08+00:00\",\"dateModified\":\"2024-07-10T02:05:52+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=1169#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=1169#webpage\"},\"articleSection\":\"VBA \\\/ VBS\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=1169#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/craftcookcode.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=13#listItem\",\"name\":\"Code\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=13#listItem\",\"position\":2,\"name\":\"Code\",\"item\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=13\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=52#listItem\",\"name\":\"VBA \\\/ VBS\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=52#listItem\",\"position\":3,\"name\":\"VBA \\\/ VBS\",\"item\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=52\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=1169#listItem\",\"name\":\"Excel &#038; VBA &#8211; Concatenating two fields together with formatting\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=13#listItem\",\"name\":\"Code\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=1169#listItem\",\"position\":4,\"name\":\"Excel &#038; VBA &#8211; Concatenating two fields together with formatting\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=52#listItem\",\"name\":\"VBA \\\/ VBS\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/#person\",\"name\":\"jonny.donker@gmail.com\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=1169#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/12ea7810156e378894993fa29611c905482263dd05898a50ae5ece294bb6aff0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"jonny.donker@gmail.com\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?author=1#author\",\"url\":\"https:\\\/\\\/craftcookcode.com\\\/?author=1\",\"name\":\"jonny.donker@gmail.com\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=1169#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/12ea7810156e378894993fa29611c905482263dd05898a50ae5ece294bb6aff0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"jonny.donker@gmail.com\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=1169#webpage\",\"url\":\"https:\\\/\\\/craftcookcode.com\\\/?p=1169\",\"name\":\"Excel & VBA \\u2013 Concatenating two fields together with formatting - Craft Cook Code\",\"description\":\"A work colleague asked me to do a \\\"Mate's rate\\\" job for his team yesterday. They had a MS Word document with a huge table in it that they needed to convert to Excel to load into an application. Paraphrased it looked like this: My first thought was to copy this table out and paste\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=1169#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?author=1#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?author=1#author\"},\"datePublished\":\"2023-06-15T07:04:08+00:00\",\"dateModified\":\"2024-07-10T02:05:52+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/#website\",\"url\":\"https:\\\/\\\/craftcookcode.com\\\/\",\"name\":\"Craft Cook Code\",\"description\":\"c^3?\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Excel & VBA \u2013 Concatenating two fields together with formatting - Craft Cook Code","description":"A work colleague asked me to do a \"Mate's rate\" job for his team yesterday. They had a MS Word document with a huge table in it that they needed to convert to Excel to load into an application. Paraphrased it looked like this: My first thought was to copy this table out and paste","canonical_url":"https:\/\/craftcookcode.com\/?p=1169","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/craftcookcode.com\/?p=1169#blogposting","name":"Excel & VBA \u2013 Concatenating two fields together with formatting - Craft Cook Code","headline":"Excel &#038; VBA &#8211; Concatenating two fields together with formatting","author":{"@id":"https:\/\/craftcookcode.com\/?author=1#author"},"publisher":{"@id":"https:\/\/craftcookcode.com\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/craftcookcode.com\/wp-content\/uploads\/2023\/06\/code_excel_concat_01.png","@id":"https:\/\/craftcookcode.com\/?p=1169\/#articleImage","width":1916,"height":634},"datePublished":"2023-06-15T07:04:08+00:00","dateModified":"2024-07-10T02:05:52+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/craftcookcode.com\/?p=1169#webpage"},"isPartOf":{"@id":"https:\/\/craftcookcode.com\/?p=1169#webpage"},"articleSection":"VBA \/ VBS"},{"@type":"BreadcrumbList","@id":"https:\/\/craftcookcode.com\/?p=1169#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/craftcookcode.com#listItem","position":1,"name":"Home","item":"https:\/\/craftcookcode.com","nextItem":{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?cat=13#listItem","name":"Code"}},{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?cat=13#listItem","position":2,"name":"Code","item":"https:\/\/craftcookcode.com\/?cat=13","nextItem":{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?cat=52#listItem","name":"VBA \/ VBS"},"previousItem":{"@type":"ListItem","@id":"https:\/\/craftcookcode.com#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?cat=52#listItem","position":3,"name":"VBA \/ VBS","item":"https:\/\/craftcookcode.com\/?cat=52","nextItem":{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?p=1169#listItem","name":"Excel &#038; VBA &#8211; Concatenating two fields together with formatting"},"previousItem":{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?cat=13#listItem","name":"Code"}},{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?p=1169#listItem","position":4,"name":"Excel &#038; VBA &#8211; Concatenating two fields together with formatting","previousItem":{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?cat=52#listItem","name":"VBA \/ VBS"}}]},{"@type":"Person","@id":"https:\/\/craftcookcode.com\/#person","name":"jonny.donker@gmail.com","image":{"@type":"ImageObject","@id":"https:\/\/craftcookcode.com\/?p=1169#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/12ea7810156e378894993fa29611c905482263dd05898a50ae5ece294bb6aff0?s=96&d=mm&r=g","width":96,"height":96,"caption":"jonny.donker@gmail.com"}},{"@type":"Person","@id":"https:\/\/craftcookcode.com\/?author=1#author","url":"https:\/\/craftcookcode.com\/?author=1","name":"jonny.donker@gmail.com","image":{"@type":"ImageObject","@id":"https:\/\/craftcookcode.com\/?p=1169#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/12ea7810156e378894993fa29611c905482263dd05898a50ae5ece294bb6aff0?s=96&d=mm&r=g","width":96,"height":96,"caption":"jonny.donker@gmail.com"}},{"@type":"WebPage","@id":"https:\/\/craftcookcode.com\/?p=1169#webpage","url":"https:\/\/craftcookcode.com\/?p=1169","name":"Excel & VBA \u2013 Concatenating two fields together with formatting - Craft Cook Code","description":"A work colleague asked me to do a \"Mate's rate\" job for his team yesterday. They had a MS Word document with a huge table in it that they needed to convert to Excel to load into an application. Paraphrased it looked like this: My first thought was to copy this table out and paste","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/craftcookcode.com\/#website"},"breadcrumb":{"@id":"https:\/\/craftcookcode.com\/?p=1169#breadcrumblist"},"author":{"@id":"https:\/\/craftcookcode.com\/?author=1#author"},"creator":{"@id":"https:\/\/craftcookcode.com\/?author=1#author"},"datePublished":"2023-06-15T07:04:08+00:00","dateModified":"2024-07-10T02:05:52+00:00"},{"@type":"WebSite","@id":"https:\/\/craftcookcode.com\/#website","url":"https:\/\/craftcookcode.com\/","name":"Craft Cook Code","description":"c^3?","inLanguage":"en-US","publisher":{"@id":"https:\/\/craftcookcode.com\/#person"}}]},"og:locale":"en_US","og:site_name":"Craft Cook Code - c^3?","og:type":"article","og:title":"Excel &amp; VBA \u2013 Concatenating two fields together with formatting - Craft Cook Code","og:description":"A work colleague asked me to do a &quot;Mate's rate&quot; job for his team yesterday. They had a MS Word document with a huge table in it that they needed to convert to Excel to load into an application. Paraphrased it looked like this: My first thought was to copy this table out and paste","og:url":"https:\/\/craftcookcode.com\/?p=1169","article:published_time":"2023-06-15T07:04:08+00:00","article:modified_time":"2024-07-10T02:05:52+00:00","twitter:card":"summary_large_image","twitter:title":"Excel &amp; VBA \u2013 Concatenating two fields together with formatting - Craft Cook Code","twitter:description":"A work colleague asked me to do a &quot;Mate's rate&quot; job for his team yesterday. They had a MS Word document with a huge table in it that they needed to convert to Excel to load into an application. Paraphrased it looked like this: My first thought was to copy this table out and paste"},"aioseo_meta_data":{"post_id":"1169","title":null,"description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"BlogPosting","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2023-06-15 07:10:10","updated":"2025-06-04 13:10:33","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/craftcookcode.com\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/craftcookcode.com\/?cat=13\" title=\"Code\">Code<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/craftcookcode.com\/?cat=52\" title=\"VBA \/ VBS\">VBA \/ VBS<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tExcel &amp; VBA \u2013 Concatenating two fields together with formatting\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/craftcookcode.com"},{"label":"Code","link":"https:\/\/craftcookcode.com\/?cat=13"},{"label":"VBA \/ VBS","link":"https:\/\/craftcookcode.com\/?cat=52"},{"label":"Excel &#038; VBA &#8211; Concatenating two fields together with formatting","link":"https:\/\/craftcookcode.com\/?p=1169"}],"_links":{"self":[{"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/posts\/1169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1169"}],"version-history":[{"count":6,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/posts\/1169\/revisions"}],"predecessor-version":[{"id":1444,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/posts\/1169\/revisions\/1444"}],"wp:attachment":[{"href":"https:\/\/craftcookcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}