0

I need to make a somewhat complicated find and replace, using wildcards, but cannot think of an elegant solution. For i.e., I would like to find any word that starts with "A-?" and "B-?", and do two things: 1) change the font size of A and B, and 2) Make sure that "?" (which can be any letter from A to Z) is uppercase.

For i.e., A-apple, will be replaced with A-Apple (where the font size of A is different from the font size of everything else, let's say 10).

This is what I have so far for finding the words.

(<[AB])(-)(?)

Any suggestions on how to make the replacement?

braX
  • 11,506
  • 5
  • 20
  • 33
aagg
  • 13
  • 3

1 Answers1

0

For complex searches see this: regex search

For partial formatting the cell text, see the examples below:

Cells(1, 1) = "Stackoverflow"
Cells(1, 1).Characters(Start:=1, Length:=2).Font.Color = RGB(255, 0, 255)
Cells(1, 1).Characters(Start:=4, Length:=2).Font.bold=true
Cells(1, 1).Characters(Start:=8, Length:=2).Font.size=14
AcsErno
  • 1,597
  • 1
  • 7
  • 10