I have two cells (let"s say A1 and B1) with same content, but not same formatting (borders, size, background, etc.)
I need to have the same bold words in the two cells. But I don't want to change any other formattings of A1 and B1
I've made a loop on the text in A1 in order to detect if each letter is in bold or not:
For i = 1 To Len([A1])
If [A1].Characters(i, 1).Font.Bold = True Then [B1].Characters(i, 1).Font.Bold = True
Next i
When the length of the text in A1 exceeds 200 letters, this loop takes several seconds to execute, and I need to optimize it.
My idea is to transfer the "[A1].characters" object in a variable, in order to check faster whether each letter of A1 is in bold or not.
So I create the object [A1].characters:
set chr=[A1].characters
How can I get the property "bold/not bold" of each letter of the text?
(I'vee been looking for a way to build an array which dimension is the number of letters of A1, with 1's for bold letters and 0's for not bold letters, but I can't find it)
Thanks in advance for your help.
B1
you want to keep, copy cellA1
intoB1
, then apply the original formatting back onB1
.