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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| Sub essai()
Dim lig As Long
Dim col As Long
Dim k As Long
Dim l As Long
Dim m As Long
Dim n As Long
Dim nombre As Long
Dim tabl() As String
Dim table() As String
Dim nbr
Dim nbre
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
For lig = 37 To 63
For col = 11 To 27
If Cells(lig, col).Value <> "-" Then
ReDim tabl(0)
ReDim table(0)
nbr = 0
For k = 58 To 77
If Cells(lig, 9).Value > Cells(k, 2) And Cells(lig, 9).Value < Cells(k, 4) Then
nbr = nbr + 1
ReDim Preserve tabl(nbr)
tabl(nbr) = Cells(k, 1).Value
End If
Next k
nbre = 0
For l = 36 To 55
If Cells(lig, col).Value > Cells(l, 2) And Cells(lig, col).Value < Cells(l, 4) Then
nbre = nbre + 1
ReDim Preserve table(nbre)
table(nbre) = Cells(l, 1).Value
End If
Next l
For m = 1 To UBound(tabl)
For n = 1 To UBound(table)
If tabl(m) = table(n) Then
nombre = nombre + 1
Cells(nombre, 5).Value = tabl(m)
Cells(nombre, 6).Value = Cells(lig, 10).Value
Cells(nombre, 7).Value = Cells(3, col).Value
End If
Next n
Next m
End If
Next col
Next lig
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
MsgBox "Terminé"
End Sub |
Partager