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
| Sub AlimenteOnglet()
Dim Tbl, x As Long, Dl As Range, y As Long, z As Long
Dim Ws As Worksheet
With Sheets("Feuil1")
Set Dl = .Range("E" & .Rows.Count).End(xlUp)
Tbl = .Range("A1", Dl(1, 8))
End With
For Each Ws In Worksheets
z = 1
For x = 1 To UBound(Tbl, 1)
With Ws
If Trim(.Name) = Trim(Tbl(x, 5)) Then
If z = 1 Then
Set Dl = .Range("E" & .Rows.Count).End(xlUp)
.Range("A1", Dl(1, 8)).ClearContents
End If
For y = 1 To 12
.Cells(1, y) = Tbl(1, y)
Next y
z = z + 1
For y = 1 To 12
.Cells(z, y) = Tbl(x, y)
Next y
End If
End With
Next x
Next Ws
End Sub |
Partager