Hi all,
Hope you all doing well.
I need some little help here.
I found the following code in the internet and seems to be partially working for what I need.
I was wondering if the following code can be modified so it can bold the word "Chapter" with any number (could be any number from 1 up to 150) in the document.
Thank you for your support.
Sub Formatting_Chapter()
Dim A(3) As String
A(1) = "Chapter 1"
A(2) = "Chapter 2"
A(3) = "Chapter 3"
For i = 1 To 3
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Replacement.Font.Bold = True
.Replacement.Font.ColorIndex = wdRed
.Execute FindText:=A(i), ReplaceWith:=A(i), Format:=True, _
Replace:=wdReplaceAll
End With
Next i
End Sub