I have the following task:
I have an Excele with cases and a Lists with agents. Furthermore, I have a third data compilation with the content of the agent's name and how many cases he currently has. The maximum number of cases an employee may have comes from the lists.
Now I have a loop in which I view each case. If it meets certain criteria, the current data of the employee is loaded in a case. In a loop within the case, the employees are now run through and the case numbers are assigned in a further loop. A comparison is then made as to whether the current number of cases is smaller than the maximum number of cases. If it is smaller, something is written to Excel. That works so far. But with an error. I was expecting the data to be written to the table when there is the first match. But now it rewrites with each pass if it is smaller. I had thought about changing to a Do until loop. However, I have no idea how this works.