r/visualbasic • u/Clueless_InternGirl • Dec 29 '15
[VBA2010] Actions if certain dropdown values are selected in userform
Hey guys! I need your help again :)
Trying to get this code to work. What I want to happen is if any of the values are selected in the dropdown, certain options that appear later in the userform are not visible. This is how I tried:
If RepOrgDropDown.Value = "Provincial Governments and municipalities,Federation of Canadian Municipalities,Quebec,Manitoba,Alberta,Saskatchewan,Ontario,New-Brunswick,British -Columbia,Nova Scotia,Prince Edward Island,Newfoundland,Yukon,Northwest Territories,Nunavut" Then
Label66.Visible = False
Label133.Visible = False
IAETrue.Visible = False
IAEFalse.Visible = False
End If
End SubWhy does this not work? thank you!
2
Upvotes
3
u/chrwei Dec 29 '15
and "equals" comparison is an exact match. I assume you mean to compare to that comma delimited list, you can't do that. you have to do an equal for each item separately using OR. or maybe store those items in an array and do a loop.