1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| Private Function rechercher(a As Long, b As Range)
Dim trouve As Range
Set trouve = b.Cells.Find(what:=a, LookAt:=xlWhole)
If trouve Is Nothing Then
rechercher = True
Else
rechercher = False
End If
End Function
Private Sub classement_des_taches()
Dim card As Long
Dim i As Long
Dim k As Long
Dim j As Long
card = 0
Dim nombre_totale_des_taches As Long
nombre_totale_des_taches = ThisWorkbook.Worksheets("page d'accueil").Cells(2, 3)
Do While card <= nombre_totale_des_taches
For i = 1 To nombre_totale_des_taches
Call rechercher(i, ThisWorkbook.Worksheets("precedence").Cells(i + 2, 2))
If rechercher(i, ThisWorkbook.Worksheets("precedence").Cells(i + 2, 2)) = True Then
For k = nombre_totale_des_taches To 1
If rechercher(i, ThisWorkbook.Worksheets("precedence").Range("A:A")) = False Then
ThisWorkbook.Worksheets("classement par precedence").Active
Cells(k, 1).Value = ThisWorkbook.Worksheets("precedence").Cells(i + 2, 1)
Cells(k, 2).Value = ThisWorkbook.Worksheets("precedence").Cells(i + 2, 2)
End If
Next k
End If
Next i
Loop
End Sub
Sub hhh()
Call classement_des_taches
End Sub |
Partager