String variables:
strAnimal
strThing
strNature
strExclamation
.Range("B9") = "The little " & strAnimal & " jumped over the " & strThing & " in the " & strNature & ", and said " & strExclamation
OK, in the above, my contemplated solution to make strNature show up in bold font is to get the length of each of the preceding variables (strAnimal & strThing), add that to the stipulated text prior to strNature (36), add the two together (let's call that lResult, a long variable, so if strAnimal is 12 and strThing is 10 we would have 36 + 12 + 10 = 58, lResult = 58) and then write:
wsStory.Range("B9").Characters(Start:=58, Length:=Len(strNature)).Font.FontStyle = "Bold"
Is there an easier way to accomplish this? This isn't the only time i need to bold something within a text string, so if there is a shortcut, i want to know!
Bookmarks