I can't quite tell if this forum is for excel only vba, or if general vba questions can be asked, so I'll ask for forgiveness if it is excel only vba because this relates to a word document I'm working on.
My question is: how does one create a drop down list using vba? I used to use this code for a set of dependent drop downs, but I now only need to populate one drop down list and the code doesn't translate over.
Sub CascadeList()
If ActiveDocument.FormFields("DropDown1").DropDown.Value = 0 Then
ActiveDocument.FormFields("Dropdown2").DropDown.ListEntries.Clear
Exit Sub
End If
Select Case ActiveDocument.FormFields("Dropdown1").Result
Case " "
With ActiveDocument.FormFields("Dropdown2").DropDown.ListEntries
.Clear
.Add " "
Case "Admin and Support Svcs"
With ActiveDocument.FormFields("Dropdown2").DropDown.ListEntries
.Clear
.Add "Administrative Support"
.Add "Executive"
.Add "Safety & Security"
.Add "Transportation"
.Add "Travel"
End With
Case "Business Development"
With ActiveDocument.FormFields("Dropdown2").DropDown.ListEntries
.Clear
.Add "Business Development"
.Add "Business Strategy"
.Add "Executive"
End With
Case "Call Center"
With ActiveDocument.FormFields("Dropdown2").DropDown.ListEntries
.Clear
.Add "Customer Service"
.Add "Repair & Product Support"
End With
End Select
End Sub
Bookmarks