• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Logic to loop through a set of tasks and assign employees equal no of task

rishita123

New Member
Hi All,

I have an issue developing a VBA program for a small logic.

I need help with a small VBA logic that can loop through a set of tasks and assign Employees to the tasks.

Process:

I have a set of tasks (Task 1 to Task10)( changes daily)
I have n no of employees present( no of employees present changes daily). Everyday I allocate same no of tasks to each employee For e.g
5 employees present today and we have 20 task today
so each employee needs to do 4 tasks
I need the macro to loop these tasks and assign to employees

Final output will be similar to this:
task 1 employee 1
task 2 employee 1
task 3 employee 2
task 4 employee 2
task 5 employee 3
task 6 employee 3
task 7 employee 4
task 8 employee 4
task 9 employee 5
task 10 employee 5

The challenge I have is that the % of allocation changes everyday and occasional an additional employee(s) added.

I would be grateful to anyone who can help me with this logic.

Thanks in advance,
Regards,
Rishita
 
I am attaching the file for reference. Please have a look at sheet1 and sheet 2
 

Attachments

  • task.xlsx
    8.6 KB · Views: 23
Hi All,

I have an issue developing a VBA program for a small logic.

I need help with a small VBA logic that can loop through a set of tasks and assign Employees to the tasks.

Process:

I have a set of tasks (Task 1 to Task10)( changes daily)
I have n no of employees present( no of employees present changes daily). Everyday I allocate same no of tasks to each employee For e.g
5 employees present today and we have 20 task today
so each employee needs to do 4 tasks
I need the macro to loop these tasks and assign to employees

Final output will be similar to this:
task 1 employee 1
task 2 employee 1
task 3 employee 2
task 4 employee 2
task 5 employee 3
task 6 employee 3
task 7 employee 4
task 8 employee 4
task 9 employee 5
task 10 employee 5

The challenge I have is that the % of allocation changes everyday and occasional an additional employee(s) added.

I would be grateful to anyone who can help me with this logic.

Thanks in advance,
Regards,
Rishita
 

Attachments

  • task.xlsx
    8.6 KB · Views: 5
rishita123
Press [ Tasks ]-button
Hi

Thanks for the help. Really helpful.
One quick question-
The tasks are assigned to users as task 1 - A , task 2 - B and so on...
Can't we make any changes so that tasks are assigned to first name and so on...
Example - 3 task to each individual..
So output like-
Task 1 - A
Task 2 -A
Task 3 - A
Task 4 - B
task 5 - B
Task 5 - B.

Thanks for the help.
Regards,
Rishita Mittal
 
rishita123
I can do that possible too ...
It would be better to write all needed at once.
( eg similar can be almost anything )
 

Attachments

  • task.xlsb
    18.8 KB · Views: 16
Last edited:
rishita123
I can do that possible too ...
It would be better to write all needed at once.
( eg similar can be almost anything )
Hi
I have one more issue .
I have some employees and I write the no of task that needs to be assigned to each individual.
and accordingly it gets assigned.
Example
On sheet 1

Name tasks to be assigned
A 3
B 2
C 1
D 1

On sheet 2
it is written as
Task 1
Task 2
Task 3
Task 4
Task 5
Task 6
Task 7

Output we need is :

Task 1 A
Task 2 A
Task 3 A
Task 4 B
Task 5 B
Task 6 C
Task 7 D


Attaching the file for your reference.
Tasks and no of tasks assigned to each individual changes.

Thanks in advance.
Regards,
Rishita
 

Attachments

  • Assign.xlsx
    8.4 KB · Views: 3
rishita123
If B-column has numbers then Your "I have one more issue ." ... works.
( There is NO error checking! )
 

Attachments

  • task.xlsb
    20.3 KB · Views: 25
rishita123
If B-column has numbers then Your "I have one more issue ." ... works.
( There is NO error checking! )
Thank you so much
but there is one error coming .
If no of cases assigned to any user is 0/ blank
it is not moving to another cell.
It is assigning the the tasks for the above users only
 
rishita123
Could You please, reread You needs from #9 reply?
Is there something, which You maybe tried to explain above?
If Yes - then let me know where?
 
Back
Top