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 42
| Sub essai_priorite()
Dim tabpriorite(22) As Integer
Dim tabCL5(22) As String
Dim tabCL4(22) As String
Dim tabCAA(22) As String
Dim macellule As Range
' ActiveWorkbook.Worksheets("RTC").Activate
' ActiveSheet.Range("B2").Activate
'construction tableau de référence
For Each macellule In ActiveWorkbook.Worksheets("Priorite").Range("A2:A23")
tabCAA(I) = macellule.Value
tabCL4(I) = macellule.Offset(0, 1).Value
tabCL5(I) = macellule.Offset(0, 2).Value
tabpriorite(I) = macellule.Offset(0, 3).Value
I = I + 1
Next macellule
'Examen de mon tableau
Sheets("RTC").Select
ActiveSheet.Range("B2").Activate
While ActiveCell.Value <> ""
For I = 0 To 22
If ActiveCell.Value = tabCAA(I) And ActiveCell.Offset(I, 2).Value = tabCL4(I) And ActiveCell.Offset(I, 5).Value = tabCL5(I) Then
ActiveCell.Offset(I, 6).Value = tabpriorite(I)
End If
Next I
ActiveCell.Offset(1, 0).Activate
Wend
End Sub |
Partager