Changing from Font 10.5 to Font 12

SteveD 625 Reputation points
2026-06-12T01:41:18.2866667+00:00

Hello From Steve

In my document I have

THURLOW O’MALLEY Font 10.5

THURLOW O’MALLEY Font 12

What is happening it is changing THURLOW O’MALLEY Font 10.5 to Font 12 What is required please to ignore Font 10.5 and not change it to Font 12

Sub Rename_Trainers()

Dim FindArray As Variant

Dim ReplArray As Variant

Dim i As Long

FindArray = Array("MCKAY HARRINGTO", "RICHARDSON NORV", "D & B WEATHERLE", _

                  "THURLOW O'MALLE", "WALKER BERGERSO", "O'SULLIVAN SCOT")

ReplArray = Array("MCKAY HARRINGTON", "RICHARDSON NORVALL", "D & B WEATHERLEY", _

                  "THURLOW O'MALLEY", "WALKER BERGERSON", "O'SULLIVAN SCOTT")

For i = LBound(FindArray) To UBound(FindArray)

    With ActiveDocument.Content.Find

        .ClearFormatting

        .Replacement.ClearFormatting

        .Text = FindArray(i)

        .Replacement.Text = ReplArray(i)

        ' Apply font size 12 to the replacement text

        .Replacement.Font.Size = 12

        .Forward = True

        .Wrap = wdFindContinue

        .Format = True

        .MatchCase = True

        .MatchWholeWord = True

        .MatchWildcards = False

        .MatchSoundsLike = False

        .MatchAllWordForms = False

        .Execute Replace:=wdReplaceAll

    End With

Next i

End Sub

Microsoft 365 and Office | Word | For home | Windows
0 comments No comments

Answer accepted by question author

AI answer

2026-06-12T01:41:35.5233333+00:00

Change the code so that the font size is only applied when the found text is currently in 12-point text, or so that it does not touch existing 10.5-point text.

One straightforward way is to restrict the Find to text that already has a specific font size. For example, if only the 12-point instances should be changed (and 10.5-point instances must be left alone), set the Find font size instead of the Replacement font size:

Sub Rename_Trainers()

    Dim FindArray As Variant
    Dim ReplArray As Variant
    Dim i As Long

    FindArray = Array("MCKAY HARRINGTO", "RICHARDSON NORV", "D & B WEATHERLE", _
                      "THURLOW O'MALLE", "WALKER BERGERSO", "O'SULLIVAN SCOT")

    ReplArray = Array("MCKAY HARRINGTON", "RICHARDSON NORVALL", "D & B WEATHERLEY", _
                      "THURLOW O'MALLEY", "WALKER BERGERSON", "O'SULLIVAN SCOTT")

    For i = LBound(FindArray) To UBound(FindArray)
        With ActiveDocument.Content.Find
            .ClearFormatting
            .Replacement.ClearFormatting

            ' Find only text that is already 12 pt
            .Font.Size = 12

            .Text = FindArray(i)
            .Replacement.Text = ReplArray(i)

            ' Do NOT force a new font size on the replacement
            ' (leave .Replacement.Font.Size untouched)

            .Forward = True
            .Wrap = wdFindContinue
            .Format = True
            .MatchCase = True
            .MatchWholeWord = True
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False

            .Execute Replace:=wdReplaceAll
        End With
    Next i

End Sub

Key points:

  • .Font.Size = 12 on the Find ensures only 12-point occurrences are matched; 10.5-point text is ignored.
  • .Replacement.Font.Size is not set, so Word keeps the existing font size of the matched text.
  • .Format = True is required so that the font-size condition is honored.

If instead the requirement is to always leave 10.5-point text unchanged but still force 12-point on other sizes, run two passes: one pass that finds only 10.5-point text (with .Font.Size = 10.5 and no replacement formatting) and another pass that finds all sizes and applies .Replacement.Font.Size = 12, but exclude the 10.5-point pass from the second loop.


References:

AI-generated content may be incorrect. Read our transparency notes for more information.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.