Multiple dependent dropdown lists; with each one dependent on the last

Copper Contributor
Hi guys I have been stuck on this for a agggggeees and try as I might I cant get it to work. grateful for any help that you can offer.
 
Basically I want to create a form that has multiple dependent dropdown lists; with each one dependent on the last
 
 
Tried to follow instructions on some of the stock how-to videos but the cells don't work i.e. just do nothing.

I'm essentially trying to replicate this code, which works in word, in Excel:
 

Sub MediaMessage()

'Update by Extendoffice 2019/11/25

Dim xDirection As FormField

Dim xState As FormField

Dim xState1 As FormField

Dim xState2 As FormField

Dim xState3 As FormField

Dim xState4 As FormField

Dim xState5 As FormField

Dim xState6 As FormField

Set xDirection = ActiveDocument.FormFields("ddBusinessArea")

Set xState = ActiveDocument.FormFields("ddKeyword")

If ((xDirection Is Nothing) Or (xState Is Nothing)) Then Exit Sub

With xState.DropDown.ListEntries

.Clear

Select Case xDirection.Result

Case "East Ham"

.Add "East Ham"

Case "West Ham"

.Add "West Ham"

End Select

End With

Set xState1 = ActiveDocument.FormFields("ddWebform")

If ((xDirection Is Nothing) Or (xState1 Is Nothing)) Then Exit Sub

With xState1.DropDown.ListEntries

.Clear

Select Case xDirection.Result

Case "East Ham"

.Add "http://bit.ly/romeo-eastham"

Case "West Ham"

.Add "http://bit.ly/romeo-westham"

End Select

End With

Set xState2 = ActiveDocument.FormFields("ddArea")

If ((xDirection Is Nothing) Or (xState2 Is Nothing)) Then Exit Sub

With xState2.DropDown.ListEntries

.Clear

Select Case xDirection.Result

Case "East Ham"

.Add "East Ham"

Case "West Ham"

.Add "West Ham"

End Select

End With

Set xState3 = ActiveDocument.FormFields("ddWebsite")

If ((xDirection Is Nothing) Or (xState3 Is Nothing)) Then Exit Sub

With xState3.DropDown.ListEntries

.Clear

Select Case xDirection.Result

Case "East Ham"

.Add "http://bit.ly/romeo-eastham"

Case "West Ham"

.Add "http://bit.ly/romeo-westham"

End Select

End With

Set xState4 = ActiveDocument.FormFields("ddArea2")

If ((xDirection Is Nothing) Or (xState4 Is Nothing)) Then Exit Sub

With xState4.DropDown.ListEntries

.Clear

Select Case xDirection.Result

Case "East Ham"

.Add "East Ham"

Case "West Ham"

.Add "West Ham"

End Select

End With

Set xState5 = ActiveDocument.FormFields("ddArea3")

If ((xDirection Is Nothing) Or (xState5 Is Nothing)) Then Exit Sub

With xState5.DropDown.ListEntries

.Clear

Select Case xDirection.Result

Case "East Ham"

.Add "East Ham"

Case "West Ham"

.Add "West Ham"

End Select

End With

Set xState6 = ActiveDocument.FormFields("ddWebsite2")

If ((xDirection Is Nothing) Or (xState6 Is Nothing)) Then Exit Sub

With xState6.DropDown.ListEntries

.Clear

Select Case xDirection.Result

Case "East Ham"

.Add "http://bit.ly/romeo-eastham"

Case "West Ham"

.Add "http://bit.ly/romeo-westham"

End Select

End With

End Sub

 

 
 
 
0 Replies