1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Sub CreationTabGraf()
Dim i As Integer, j As Integer, nommag As Variant
Let i = 4
Let j = 3
Application.CutCopyMode = False
For i = 4 To shtGrafAnnee.Range("E" & Rows.Count).End(xlUp).Row Step 1
Set nommag = shtGrafAnnee.Cells(i, 5)
Do
Let j = j + 1
If j = 10 And shtGrafSem.Cells(j, 1) <> nommag Then
Exit Do
End If
Loop Until shtGrafSem.Cells(j, 1) = nommag
shtGrafSem.Cells(j, 2).Copy
shtGrafAnnee.Cells(i, 8).Paste
Let j = 3
Next i
Application.CutCopyMode = True
End Sub |