Hi All, relative newbie to VBA and MrExcel so gentle on me please...
I have information in three columns (Dept, Supervisor, Employee) that I want added to separate combobox's in a VBA userform. Each employee can only work for one supervisor, and each supervisor can only work in one department. Is there a way that once the department is chosen in combobox1 that only the relevant supervisors are listed in combobox 2, and then only the relevant employees listed in combobox3? The other problem is I need the list to be dynamic as staff numbers often change.
To prevent mismatches it would also be really useful if the lower combobox's could be cleared if the option in an early box was to change.
The data I am working with is as follows:
Dept. Supervisor Employee
1 AB CD
1 AB EF
1 AB GH
1 DB LD
1 DB SA
2 MC SH
2 MC SB
2 MC JG
2 DT AC
So if I picked Dept 1, I would want the supervisor combobox to show only AB and DB. If I then chose DB, I want employee only to show LD and SA. But if I then went back and changed supervisor DB to AB I would want employee to be cleared.
Thanks for any help!!
I have information in three columns (Dept, Supervisor, Employee) that I want added to separate combobox's in a VBA userform. Each employee can only work for one supervisor, and each supervisor can only work in one department. Is there a way that once the department is chosen in combobox1 that only the relevant supervisors are listed in combobox 2, and then only the relevant employees listed in combobox3? The other problem is I need the list to be dynamic as staff numbers often change.
To prevent mismatches it would also be really useful if the lower combobox's could be cleared if the option in an early box was to change.
The data I am working with is as follows:
Dept. Supervisor Employee
1 AB CD
1 AB EF
1 AB GH
1 DB LD
1 DB SA
2 MC SH
2 MC SB
2 MC JG
2 DT AC
So if I picked Dept 1, I would want the supervisor combobox to show only AB and DB. If I then chose DB, I want employee only to show LD and SA. But if I then went back and changed supervisor DB to AB I would want employee to be cleared.
Thanks for any help!!