|I have applied the code from the question posted March 20,2016 (http://www.computing.net/answers/office/how-to-make-bold-fonts-in-a-concatenated-text-in-excel/20253.html), but the code doesn'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? |
This is the code I am using:
'Copy Text From L21 to A26
Range("DeclaredISOYield") = Range("L21").Value
'Loop through B9,L23,and L24
For Each txtStr In Range("B9,L23,L24")
'Determine Start Position of text within L21
startChar = InStr(1, Range("StatedYield"), txtStr)
'Determine Length of text
lenBold = Len(txtStr)
'Bold specific characters
Range("DeclaredISOYield").Characters(31, txtStr).Font.Bold = True
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.
Thank you for your help!