Forum Discussion
RICARDO JULIO RODRIGUEZ FERNANDEZ
Oct 05, 2025Copper Contributor
Drop down menu linked to an Excel file
Hi! I would like to populate Word drop down menu to data stored in Excel spreadsheets. I found a post (https://learn.microsoft.com/en-us/answers/questions/5448059/drop-down-menu-linked-to-a-file) in ...
Kidd_Ip
Oct 06, 2025MVP
Below may be worth trying:
- A Word document with a Combo Box Content Control
- An Excel file with your list of options (e.g., in Column A)
- Access to the VBA Editor in Word (press Alt + F11)
Sub PopulateDropdownFromExcel()
Dim exlApp As Object
Dim xlWrkBok As Object
Dim sheetName As String
Dim wkbkName As String
Dim LRow As Long
Dim i As Long
' Excel file path and sheet name
wkbkName = "C:\Path\To\Your\File.xlsx"
sheetName = "Sheet1"
' Start Excel
Set exlApp = CreateObject("Excel.Application")
Set xlWrkBok = exlApp.Workbooks.Open(wkbkName, ReadOnly:=True)
With xlWrkBok.Worksheets(sheetName)
LRow = .Cells(.Rows.Count, 1).End(-4162).Row ' -4162 = xlUp
Selection.Range.ContentControls(1).DropdownListEntries.Clear
For i = 1 To LRow
Selection.Range.ContentControls(1).DropdownListEntries.Add Text:=Trim(.Cells(i, 1).Value)
Next i
End With
xlWrkBok.Close SaveChanges:=False
exlApp.Quit
End Sub
- Open your Word document.
- Insert a Combo Box Content Control from the Developer tab.
- Press Alt + F11 to open the VBA editor.
- Paste the code into a new module.
- Run the macro (F5) while your cursor is inside the Combo Box.