1 2 3 4 5 6 7
| Private Sub CommandButton1_Click()
For j = 1 To 20
For i = 1 To 15
Workbooks("Classeur2.xlsx").Sheets("Feuil1").Range(Application.Index(Workbooks("Classeur2.xlsx").Sheets("Feuil1").Range("A4:AS56"), Application.Match(Workbooks("Classeur1.xlsx").Sheets("Feuil1").Cells(1, i+1), Workbooks("Classeur2.xlsx").Sheets("Feuil1").Range("A5:A56"), 0)+1, Application.Match(Workbooks("Classeur1.xlsx").Sheets("Feuil1").Cells(j+1, 1), Workbooks("Classeur2.xlsx").Sheets("Feuil1").Range("A4:AS4"), 0)).Address).Value = Application.Index(Workbooks("Classeur1.xlsx").Sheets("Feuil1").Range("A1:P30"), Application.Match(Workbooks("Classeur1.xlsx").Sheets("Feuil1").Cells(j+1, 1), Workbooks("Classeur1.xlsx").Sheets("Feuil1").Range("A1:A30"), 0), Application.Match(Workbooks("Classeur1.xlsx").Sheets("Feuil1").Cells(1, i+1), Workbooks("Classeur1.xlsx").Sheets("Feuil1").Range("A1:P1"), 0))
Next
Next
End Sub |
Partager