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
| Option Explicit
Sub essai()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
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
For lig = 37 To 63
For col = 11 To 27
If Cells(lig, col).Value <> "-" Then
Dim tabl(500) As String
Dim table(500) As String
For k = 58 To 77
Dim nbr
If Cells(lig, 9).Value > Cells(k, 2) And Cells(lig, 9).Value < Cells(k, 4) Then
nbr = nbr + 1
tabl(nbr) = Cells(k, 1).Value
End If
Next k
For l = 36 To 55
Dim nbre
If Cells(lig, col).Value > Cells(l, 2) And Cells(lig, col).Value < Cells(l, 4) Then
nbre = nbre + 1
table(nbre) = Cells(l, 1).Value
End If
Next l
For m = 1 To 500
For n = 1 To 500
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
End Sub |
Partager