Document Editing Problems

Use Word Bookmark Cross-References in Excel VBA

Huda QurayshiHuda Qurayshi Nov 14, 2026 869 views

Question details

Use Excel VBA to populate a Word bookmark and display its text in multiple locations.

Use Word Bookmark Cross-References in Excel VBA
Product
Microsoft Word and Excel VBA
Device & OS
not provided
Scenario
An Excel VBA macro fills predefined bookmarks in a Word document, and some values need to appear more than once.
Observed behavior
Text inserted into a bookmark appears at its single bookmarked location; other locations need cross-reference fields to display the same text.
Before you start

Open the target Word document and confirm that it contains the bookmark name your macro will use. If you use the VBA example below, make the document active in Word and enable the Microsoft Word Object Library in the Excel VBA editor.

Solution 1Recommended

Insert a Word bookmark cross-reference with Excel VBA

Use this method to populate a source bookmark and insert its text as a cross-reference elsewhere in the active Word document.

A bookmark name identifies one location. A cross-reference field displays the text of that bookmark at another location; update the field after changing the source text.

Replacing a bookmark's range text can remove the bookmark, so the example recreates it around the new text before inserting the cross-reference.

1
Enable the Word library

In Excel, open the VBA editor with Alt+F11, choose Tools > References, and select Microsoft Word Object Library.

2
Add the macro

In the VBA editor, choose Insert > Module and paste this example. Replace the bookmark name and value as needed: Sub InsertBookmarkReference() Dim wordApp As Word.Application Dim doc As Word.Document Dim sourceRange As Word.Range Dim targetRange As Word.Range Set wordApp = GetObject(, "Word.Application") Set doc = wordApp.ActiveDocument Set sourceRange = doc.Bookmarks("Entity_legal_name").Range sourceRange.Text = "Example Company LLC" doc.Bookmarks.Add Name:="Entity_legal_name", Range:=sourceRange Set targetRange = doc.Range(doc.Content.End - 1, doc.Content.End - 1) targetRange.InsertCrossReference ReferenceType:="Bookmark", _ ReferenceKind:=wdContentText, _ ReferenceItem:="Entity_legal_name", _ InsertAsHyperlink:=True doc.Fields.Update End Sub

3
Run and check the reference

With the target document active in Word, run InsertBookmarkReference from the Excel VBA editor. The example inserts the reference at the end of the document; change targetRange to another Word range to place it elsewhere.

Insert a Word bookmark cross-reference with Excel VBA
Update existing fields: After changing the source bookmark, update the cross-reference fields. In Word's document body, press Ctrl+A and then F9, or right-click an individual field and select Update Field.
Free Microsoft Office alternative

Edit Word Documents with WPS Office

WPS Office is a free, lightweight alternative for editing documents and spreadsheets. Its familiar interface and Microsoft Office format compatibility make it easier to move existing files into a new workflow. Microsoft Word's VBA cross-reference automation still requires Word.

Edit documents in a familiar word-processing interfaceOpen and save Microsoft Word DOCX and Excel XLSX filesUse a free, lightweight office suite for everyday document workBring existing Office files into WPS Office without starting from scratch
microsoft office alternative - wps office

Frequently Asked Questions

Can the same Word bookmark name exist in several places?

No. A bookmark name identifies one location in a document. Insert cross-reference fields to show the bookmark's text at other locations.

Why did my bookmark disappear after my VBA macro inserted text?

Assigning text to a bookmark's Range can remove the bookmark. Keep the range in a variable, assign its Text, and use doc.Bookmarks.Add with the same name and range to recreate it.

How do I update a cross-reference after changing the source text?

In Word, right-click the cross-reference and choose Update Field. To update fields in the main document body, press Ctrl+A and then F9.

Can a bookmark cross-reference be clickable?

Yes. In VBA, set InsertAsHyperlink:=True when calling Range.InsertCrossReference. In Word's Cross-reference dialog, select the option to insert the reference as a hyperlink.

Where does the VBA example insert the repeated text?

It inserts the cross-reference at the end of the active Word document. Set targetRange to the desired Word range before calling InsertCrossReference to use a different location.