Sub keyword_count() Dim keyword(0 To 3) As String keyword(0) = "Modeling" keyword(1) = "Simulation" keyword(2) = "Science" keyword(3) = "Computer" For i = 0 To 3 Selection.GoTo What:=wdGoToHeading, Which:=wdGoToFirst Pages = "" Text = keyword(i) lastPages = "" Do While Selection.Find.Execute(Text) = True If lastPages <> Selection.Information(wdActiveEndPageNumber) Then lastPages = Selection.Information(wdActiveEndPageNumber) If Pages <> "" Then Pages = Pages & ", " End If Pages = Pages & lastPages End If Loop Selection.GoTo What:=wdGoToPage, Which:=wdGoToLast Line = Text + vbTab + vbTab + Pages + vbCrLf ActiveDocument.Content.InsertAfter Line Next i End Sub