I have a cell value that has contents that would say something like "You need to do this for CLIENT NAME. this needs to be done by 30 BUSINESS DAYS and you need to also do xyz by 30 BUSINESS DAYS"
I'm trying to update the formatting of the words that are all caps (CLIENT NAME and 30 BUSINESS DAYS) so it the output would be "You need to do this for CLIENT NAME. this needs to be done by 30 BUSINESS DAYS and you need to also do xyz by 30 BUSINESS DAYS"
I have the code below but it only updates the first 30 BUSINESS DAYS string. How would i go about also updating the 2nd 30 BUSINESS DAY string?
Dim str_variant As Variant str_variant = Array("CLIENT NAME", "30 BUSINESS DAYS") Dim s As Integer Dim str As String For s = LBound(str_variant) To UBound(str_variant) If InStr(Range("C10"), str_variant(s)) > 0 Then Dim strt_format, end_format As Integer strt_format = Application.Evaluate("=Find(""" & str_variant(s) & """,C10)") end_format = Application.Evaluate("=Len(""" & str_variant(s) & """)") With Range("C10").Characters(Start:=strt_format, Length:=end_format) With .Font .Bold = True .Underline = True End With End With End If Next
I'm not necessarily stuck with the code above so if it needs to be scrapped for a better alternative, I'd be open to that.
Any help would be appreciated.