Hi,
Can someone help me with this code?
Everthing is working fine but the execution is too slow.
There is anyway to improve it?
Thanks in advance.
Can someone help me with this code?
Everthing is working fine but the execution is too slow.
There is anyway to improve it?
Thanks in advance.
Code:
Sub AlocaçãoTarefas()
lastrow = Worksheets("Inputs Pendentes").Cells(Rows.Count, 2).End(xlUp).Row
fim = Worksheets("Input Regras").Cells(Rows.Count, 2).End(xlUp).Row
For RowPendentes = 22 To lastrow
For RowRegra = 16 To fim
If Worksheets("Inputs Pendentes").Cells(RowPendentes, 33).Value = "" Then 'Verify if there is already an employee assigned to the task
If Worksheets("Inputs Pendentes").Cells(RowPendentes, 31).Value = "Não" Then ' Verify if the task has already been assigned
If Worksheets("Inputs Pendentes").Cells(RowPendentes, 32).Value = Worksheets("Input Regras").Cells(RowRegra, 7).Value Then ' Verify if the task ID matches the employee ID
If Worksheets("Input Regras").Cells(RowRegra, 10).Value < Worksheets("Input Regras").Cells(RowRegra, 9).Value Then ' Verify if the employee’s capacity to solve tasks is full
Worksheets("Inputs Pendentes").Cells(RowPendentes, 33).Value = Worksheets("Input Regras").Cells(RowRegra, 2).Value ' Fill column W from sheet Input Pendentes with the employee’s name assigned to the task
RowRegra = fim 'Indication to stop covering allocation rules
Else
End If
Else
End If
Else
End If
Else
End If
Next RowRegra
Next RowPendentes
End Sub