{"id":2286,"date":"2021-10-28T00:33:08","date_gmt":"2021-10-28T00:33:08","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=2286"},"modified":"2021-10-28T00:33:58","modified_gmt":"2021-10-28T00:33:58","slug":"solved-how-to-bold-variable-text-in-a-concatenated-string-in-excel","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/how-to-bold-variable-text-in-a-concatenated-string-in-excel\/30493.html","title":{"rendered":"Solved How To Bold Variable Text In A Concatenated String In Excel"},"content":{"rendered":"<p>I have applied the code from the question posted March 20,2016 (https:\/\/computing.net\/answers\/office\/how-to-make-bold-fonts-in-a-concatenated-text-in-excel\/20253.html), but the code doesn&#8217;t determine the length of the text to bold, the code bolds all the text from the startChar to the end of the string. What do I need to add to bold ONLY the concatenated value from one of the cells in the string?<\/p>\n<p>This is the code I am using:<\/p>\n<p>Sub BoldSomeText2()<\/p>\n<p>&#8216;Copy Text From L21 to A26<\/p>\n<p>Range(&#8220;DeclaredISOYield&#8221;) = Range(&#8220;L21&#8221;).Value<\/p>\n<p>&#8216;Loop through B9,L23,and L24<\/p>\n<p>For Each txtStr In Range(&#8220;B9,L23,L24&#8221;)<\/p>\n<p>&#8216;Determine Start Position of text within L21<\/p>\n<p>startChar = InStr(1, Range(&#8220;StatedYield&#8221;), txtStr)<\/p>\n<p>&#8216;Determine Length of text<\/p>\n<p>lenBold = Len(txtStr)<\/p>\n<p>&#8216;Bold specific characters<\/p>\n<p>Range(&#8220;DeclaredISOYield&#8221;).Characters(31, txtStr).Font.Bold = True<\/p>\n<p>Next<br \/>\nEnd Sub<\/p>\n<p>My intent is to create a report in which the numeric result of a formula that appears in a cell (B9, in this case) concatenates with content from other cells, but only the variable numeric value from B9 is in bold face.<\/p>\n<p>Thank you for your help!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":4},"question-category":[55],"question_tags":[],"class_list":["post-2286","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/2286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=2286"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=2286"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=2286"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=2286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}