4 dependent combo boxes using VBA

Chelly Roho

New Member
Joined
Feb 8, 2018
Messages
6
I've been working on this for a while. I can relate two combo boxes only. Example of my data:

Region District Facilities
Tangwa Tangwa_Disctict Tangwa_District_Facilities

The problem I believe is that Region on has 4 entries, District has 8 but there are over 400 facilities each tied to a District which is tied to a Region. I used the Select Case routine for the first two boxes but trying to do this with the 3rd box yields an empty box after a ton of typing. Please help.

Chelly Roho
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi, good morning.

Do you using a userform?

Yes I'm using userform combo boxes. I have many columns and each with a unique name. My cmbox1 is titled REGIONS and it has 5 regions, cmbox2 is titled DISTRICTS and it has 9 districts. I have a cmbox4 for months that I filled in using Rowsource, this box is independent. The problem I'm having is that the 9 districts each have at least 10 facilities. I've been trying the select case but it's not working for the cmbox3.
 
Upvote 0
Good Morning,

My mind is already at the end of the project and I can't get past the first stage. I'm wondering if .additem would work or even an "if, then" statement. I don't know.
 
Upvote 0
Keep calm please ok?

I need to think like this: Each district and facility registry must have a relationship with the region.

Example:

IdRegionNameRegion
1re1
2re2
3re3
4re4
5re5

<colgroup><col span="2"></colgroup><tbody>
</tbody>


IdDistrictNameDistrictRegionDistrict
1di11
2di22
3di33
4di44
5di55
6di61
7di72
8di83
9di94

<colgroup><col span="3"></colgroup><tbody>
</tbody>



IdFacilityNameFacilityRegionFacilityDistrictFAcility
1Facility111
2Facility222
3Facility333
4Facility444
5Facility555
6Facility616
7Facility727
8Facility838
9Facility949
10Facility1051
11Facility1112
12Facility1223
13Facility1334
14Facility1445
15Facility1556
16Facility1617
17Facility1728
18Facility1839
19Facility1941
20Facility2052
21Facility2113
22Facility2224
23Facility2335
24Facility2446
25Facility2557
26Facility2618
27Facility2729
28Facility2831
29Facility2942
30Facility3053
31Facility3114
32Facility3225
33Facility3336
34Facility3447
35Facility3558
36Facility3619
37Facility3721
38Facility3832
39Facility3943
40Facility4054
41Facility4115
42Facility4226
43Facility4337
44Facility4448
45Facility4559
46Facility4611
47Facility4722
48Facility4833
49Facility4944
50Facility5055
51Facility5116
52Facility5227
53Facility5338
54Facility5449
55Facility5551
56Facility5612
57Facility5723
58Facility5834
59Facility5945
60Facility6056
61Facility6117
62Facility6228
63Facility6339
64Facility6441
65Facility6552
66Facility6613
67Facility6724
68Facility6835
69Facility6946
70Facility7057
71Facility7118
72Facility7229
73Facility7331
74Facility7442
75Facility7553
76Facility7614
77Facility7725
78Facility7836
79Facility7947
80Facility8058
81Facility8119
82Facility8221
83Facility8332
84Facility8443
85Facility8554
86Facility8615
87Facility8726
88Facility8837
89Facility8948
90Facility9059

<colgroup><col span="4"></colgroup><tbody>
</tbody>

That way you will be able to make the relationship between the combos work as you need it.
I'm not done yet, I'll try to help you more, for now think about it ok?


Keep calm please.
 
Upvote 0
Thank you.

Region
a
b
c
d
e

Disctrict
Region a
1
2
3
4
Region b
1
2
3
4
5
6
District c
1
2
3
4

Then each District has several facilities attached.
District d
1
2
3
4
 
Upvote 0
So how do I do this. I've tried dynamic name range loop then case select. Two boxes work fine but the third is erroneous.

Chelly
 
Upvote 0

Forum statistics

Threads
1,214,824
Messages
6,121,783
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top