(Solved) – Concatenating strings into a range with alternating font formatting [duplicate]


This question already has an answer here:

I’m trying to concatenate a string out of some string bits and variable data with the code that looks like this:

HeadersRange.Text = "ID 1: " & ID1_value & "ID 2: " & ID2_value

The end result should look like this:

enter image description here
Here, the ID 1: and ID 2: bits are in bold text while the numbers are not. How do I achieve this? Neither “string” nor “integer” data types content the “font” property, so I can’t make ID 1 and ID 2 bold before I insert them. I could concatenate the string, and then do the font formatting on the several parts of the string, but navigating the range is messy and requires me to know the amount of words in every bit up front. What is the best solution?

Leave a Reply

Your email address will not be published. Required fields are marked *