PDA

View Full Version : Find duplicates in combobox - get index and remove from other comboboxes.



NicheD
05-08-2023, 01:52 AM
Hello,

I have a userform where you can create timetables for work. You can either chose specific dates or reoccuring by selecting a day of the week.
I have four comboboxes in a userform. One of them is filled with dates, one with user-ID and one if the user works on the specific date or not.
There is two options

In the fourth combobox the strings consists of the date, user-id and "Yes" or "no". For example "2023-05-08 JAKE NO"
I want to loop through the fourth combobox and search for items that are the same up until the date and udsr-id. If there are more than one, I want the index-number of the one ending with "NO", and deleate the same index items in combobox 1, 2 and 3.

Thans in advance.

Aussiebear
05-08-2023, 02:29 AM
May we know the names of these comboboxes?

NicheD
05-08-2023, 03:26 AM
May we know the names of these comboboxes?


Hi

CmbDate - contains dates
CmbUsr - contains user-id
CmbYN - contains either yes or no

CmbDateUsr - contains dates, user-Id and yes or no

So if CmbDateUsr contain two items with the same date and user-id, then remove the one ending with no, and also remove the items with the same index number from CmbDate, CmbUsr and CmbYN! :)