Home

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

%3CLINGO-SUB%20id%3D%22lingo-sub-840390%22%20slang%3D%22en-US%22%3EMultiple%20dependent%20dropdown%20lists%3B%20with%20each%20one%20dependent%20on%20the%20last%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-840390%22%20slang%3D%22en-US%22%3E%3CDIV%20class%3D%22im_history_message_wrap%20im_message_unread%22%3E%3CDIV%20class%3D%22im_message_outer_wrap%20hasselect%22%3E%3CDIV%20class%3D%22im_message_wrap%20clearfix%22%3E%3CDIV%20class%3D%22im_content_message_wrap%20im_message_out%22%3E%3CDIV%20class%3D%22im_message_body%22%3E%3CDIV%3E%3CDIV%20class%3D%22im_message_text%22%3EHi%20guys%20I%20have%20been%20stuck%20on%20this%20for%20a%20agggggeees%20and%20try%20as%20I%20might%20I%20cant%20get%20it%20to%20work.%20grateful%20for%20any%20help%20that%20you%20can%20offer.%3C%2FDIV%3E%3CDIV%20class%3D%22im_message_text%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22im_message_text%22%3E%3CDIV%20class%3D%22im_history_message_wrap%20im_message_unread%22%3E%3CDIV%20class%3D%22im_message_outer_wrap%20hasselect%22%3E%3CDIV%20class%3D%22im_message_wrap%20clearfix%22%3E%3CDIV%20class%3D%22im_content_message_wrap%20im_message_out%22%3E%3CDIV%20class%3D%22im_message_body%22%3E%3CDIV%3E%3CDIV%20class%3D%22im_message_text%22%3E%3CDIV%20class%3D%22im_message_text%22%3EBasically%20I%20want%20to%20create%20a%20form%20that%20has%20multiple%20dependent%20dropdown%20lists%3B%20with%20each%20one%20dependent%20on%20the%20last%3C%2FDIV%3E%3CDIV%20class%3D%22im_message_text%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22im_history_message_wrap%20im_grouped_short%20im_message_unread%22%3E%3CDIV%20class%3D%22im_message_outer_wrap%20hasselect%22%3E%3CDIV%20class%3D%22im_message_wrap%20clearfix%22%3E%3CDIV%20class%3D%22im_content_message_wrap%20im_message_out%22%3E%3CDIV%20class%3D%22im_message_meta%20pull-right%20text-right%20noselect%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22im_message_body%22%3E%3CDIV%3E%3CDIV%20class%3D%22im_message_text%22%3ETried%20to%20follow%20instructions%20on%20some%20of%20the%20stock%20how-to%20videos%20but%20the%20cells%20don't%20work%20i.e.%20just%20do%20nothing.%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22im_message_text%22%3E%3CBR%20%2F%3EI'm%20essentially%20trying%20to%20replicate%20this%20code%2C%20which%20works%20in%20word%2C%20in%20Excel%3A%3C%2FDIV%3E%3CDIV%20class%3D%22im_message_text%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22im_message_text%22%3E%3CP%3ESub%20MediaMessage()%3C%2FP%3E%3CP%3E'Update%20by%20Extendoffice%202019%2F11%2F25%3C%2FP%3E%3CP%3EDim%20xDirection%20As%20FormField%3C%2FP%3E%3CP%3EDim%20xState%20As%20FormField%3C%2FP%3E%3CP%3EDim%20xState1%20As%20FormField%3C%2FP%3E%3CP%3EDim%20xState2%20As%20FormField%3C%2FP%3E%3CP%3EDim%20xState3%20As%20FormField%3C%2FP%3E%3CP%3EDim%20xState4%20As%20FormField%3C%2FP%3E%3CP%3EDim%20xState5%20As%20FormField%3C%2FP%3E%3CP%3EDim%20xState6%20As%20FormField%3C%2FP%3E%3CP%3ESet%20xDirection%20%3D%20ActiveDocument.FormFields(%22ddBusinessArea%22)%3C%2FP%3E%3CP%3ESet%20xState%20%3D%20ActiveDocument.FormFields(%22ddKeyword%22)%3C%2FP%3E%3CP%3EIf%20((xDirection%20Is%20Nothing)%20Or%20(xState%20Is%20Nothing))%20Then%20Exit%20Sub%3C%2FP%3E%3CP%3EWith%20xState.DropDown.ListEntries%3C%2FP%3E%3CP%3E.Clear%3C%2FP%3E%3CP%3ESelect%20Case%20xDirection.Result%3C%2FP%3E%3CP%3ECase%20%22East%20Ham%22%3C%2FP%3E%3CP%3E.Add%20%22East%20Ham%22%3C%2FP%3E%3CP%3ECase%20%22West%20Ham%22%3C%2FP%3E%3CP%3E.Add%20%22West%20Ham%22%3C%2FP%3E%3CP%3EEnd%20Select%3C%2FP%3E%3CP%3EEnd%20With%3C%2FP%3E%3CP%3ESet%20xState1%20%3D%20ActiveDocument.FormFields(%22ddWebform%22)%3C%2FP%3E%3CP%3EIf%20((xDirection%20Is%20Nothing)%20Or%20(xState1%20Is%20Nothing))%20Then%20Exit%20Sub%3C%2FP%3E%3CP%3EWith%20xState1.DropDown.ListEntries%3C%2FP%3E%3CP%3E.Clear%3C%2FP%3E%3CP%3ESelect%20Case%20xDirection.Result%3C%2FP%3E%3CP%3ECase%20%22East%20Ham%22%3C%2FP%3E%3CP%3E.Add%20%22%3CA%20href%3D%22http%3A%2F%2Fbit.ly%2Fromeo-eastham%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fbit.ly%2Fromeo-eastham%3C%2FA%3E%22%3C%2FP%3E%3CP%3ECase%20%22West%20Ham%22%3C%2FP%3E%3CP%3E.Add%20%22%3CA%20href%3D%22http%3A%2F%2Fbit.ly%2Fromeo-westham%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fbit.ly%2Fromeo-westham%3C%2FA%3E%22%3C%2FP%3E%3CP%3EEnd%20Select%3C%2FP%3E%3CP%3EEnd%20With%3C%2FP%3E%3CP%3ESet%20xState2%20%3D%20ActiveDocument.FormFields(%22ddArea%22)%3C%2FP%3E%3CP%3EIf%20((xDirection%20Is%20Nothing)%20Or%20(xState2%20Is%20Nothing))%20Then%20Exit%20Sub%3C%2FP%3E%3CP%3EWith%20xState2.DropDown.ListEntries%3C%2FP%3E%3CP%3E.Clear%3C%2FP%3E%3CP%3ESelect%20Case%20xDirection.Result%3C%2FP%3E%3CP%3ECase%20%22East%20Ham%22%3C%2FP%3E%3CP%3E.Add%20%22East%20Ham%22%3C%2FP%3E%3CP%3ECase%20%22West%20Ham%22%3C%2FP%3E%3CP%3E.Add%20%22West%20Ham%22%3C%2FP%3E%3CP%3EEnd%20Select%3C%2FP%3E%3CP%3EEnd%20With%3C%2FP%3E%3CP%3ESet%20xState3%20%3D%20ActiveDocument.FormFields(%22ddWebsite%22)%3C%2FP%3E%3CP%3EIf%20((xDirection%20Is%20Nothing)%20Or%20(xState3%20Is%20Nothing))%20Then%20Exit%20Sub%3C%2FP%3E%3CP%3EWith%20xState3.DropDown.ListEntries%3C%2FP%3E%3CP%3E.Clear%3C%2FP%3E%3CP%3ESelect%20Case%20xDirection.Result%3C%2FP%3E%3CP%3ECase%20%22East%20Ham%22%3C%2FP%3E%3CP%3E.Add%20%22%3CA%20href%3D%22http%3A%2F%2Fbit.ly%2Fromeo-eastham%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fbit.ly%2Fromeo-eastham%3C%2FA%3E%22%3C%2FP%3E%3CP%3ECase%20%22West%20Ham%22%3C%2FP%3E%3CP%3E.Add%20%22%3CA%20href%3D%22http%3A%2F%2Fbit.ly%2Fromeo-westham%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fbit.ly%2Fromeo-westham%3C%2FA%3E%22%3C%2FP%3E%3CP%3EEnd%20Select%3C%2FP%3E%3CP%3EEnd%20With%3C%2FP%3E%3CP%3ESet%20xState4%20%3D%20ActiveDocument.FormFields(%22ddArea2%22)%3C%2FP%3E%3CP%3EIf%20((xDirection%20Is%20Nothing)%20Or%20(xState4%20Is%20Nothing))%20Then%20Exit%20Sub%3C%2FP%3E%3CP%3EWith%20xState4.DropDown.ListEntries%3C%2FP%3E%3CP%3E.Clear%3C%2FP%3E%3CP%3ESelect%20Case%20xDirection.Result%3C%2FP%3E%3CP%3ECase%20%22East%20Ham%22%3C%2FP%3E%3CP%3E.Add%20%22East%20Ham%22%3C%2FP%3E%3CP%3ECase%20%22West%20Ham%22%3C%2FP%3E%3CP%3E.Add%20%22West%20Ham%22%3C%2FP%3E%3CP%3EEnd%20Select%3C%2FP%3E%3CP%3EEnd%20With%3C%2FP%3E%3CP%3ESet%20xState5%20%3D%20ActiveDocument.FormFields(%22ddArea3%22)%3C%2FP%3E%3CP%3EIf%20((xDirection%20Is%20Nothing)%20Or%20(xState5%20Is%20Nothing))%20Then%20Exit%20Sub%3C%2FP%3E%3CP%3EWith%20xState5.DropDown.ListEntries%3C%2FP%3E%3CP%3E.Clear%3C%2FP%3E%3CP%3ESelect%20Case%20xDirection.Result%3C%2FP%3E%3CP%3ECase%20%22East%20Ham%22%3C%2FP%3E%3CP%3E.Add%20%22East%20Ham%22%3C%2FP%3E%3CP%3ECase%20%22West%20Ham%22%3C%2FP%3E%3CP%3E.Add%20%22West%20Ham%22%3C%2FP%3E%3CP%3EEnd%20Select%3C%2FP%3E%3CP%3EEnd%20With%3C%2FP%3E%3CP%3ESet%20xState6%20%3D%20ActiveDocument.FormFields(%22ddWebsite2%22)%3C%2FP%3E%3CP%3EIf%20((xDirection%20Is%20Nothing)%20Or%20(xState6%20Is%20Nothing))%20Then%20Exit%20Sub%3C%2FP%3E%3CP%3EWith%20xState6.DropDown.ListEntries%3C%2FP%3E%3CP%3E.Clear%3C%2FP%3E%3CP%3ESelect%20Case%20xDirection.Result%3C%2FP%3E%3CP%3ECase%20%22East%20Ham%22%3C%2FP%3E%3CP%3E.Add%20%22%3CA%20href%3D%22http%3A%2F%2Fbit.ly%2Fromeo-eastham%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fbit.ly%2Fromeo-eastham%3C%2FA%3E%22%3C%2FP%3E%3CP%3ECase%20%22West%20Ham%22%3C%2FP%3E%3CP%3E.Add%20%22%3CA%20href%3D%22http%3A%2F%2Fbit.ly%2Fromeo-westham%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fbit.ly%2Fromeo-westham%3C%2FA%3E%22%3C%2FP%3E%3CP%3EEnd%20Select%3C%2FP%3E%3CP%3EEnd%20With%3C%2FP%3E%3CP%3EEnd%20Sub%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FDIV%3E%3CDIV%20class%3D%22im_message_text%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22im_message_text%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22im_history_message_wrap%20im_grouped_short%20im_message_unread%22%3E%3CDIV%20class%3D%22im_message_outer_wrap%20hasselect%22%3E%3CDIV%20class%3D%22im_message_wrap%20clearfix%22%3E%3CDIV%20class%3D%22im_content_message_wrap%20im_message_out%22%3E%3CDIV%20class%3D%22im_message_body%22%3E%3CDIV%3E%3CDIV%20class%3D%22im_message_text%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-840390%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Kamara1275
Occasional Visitor
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

 

 
 
 
Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
16 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
11 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies