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
|
Sub direction()
' déclaration variables
Dim nbligne As Integer
nbligne = 9
Dim case_copie As Integer
case_copie = 10
Dim i As Integer
Dim j As Integer
'Nombre de ligne dans tableau
Do While (Workbooks("Fichier_Commun_ordo_qs_finition_Test.xlsm").Sheets("Feuil1").Cells(case_copie, 2).Value <> "")
nbligne = nbligne + 1
case_copie = case_copie + 1
Loop
' Copier les case 42 à 46
j=1
i = 42
Do While (i <> 46)
Range(Cells(9, i), Cells(nbligne, i)).Value.Copy Destination:=Workbooks("direction2.xls").Sheets("Direction").Cells(9, j)
i = i + 1
j = j + 1
Loop
End sub |