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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
Sub Page11()
Dim Tableau1, Li1&, Co1&
Dim Tableau2, Li2&, Co2&
Dim Tableau3, Li3&, Co3&
Application.ScreenUpdating = False
Fichier_analyse = ActiveWorkbook.Name
Windows(Fichier_analyse).Activate
lig = 1
Do
x = Cells(lig, 2).Value
y = Cells(lig + 1, 2).Value
z = Cells(lig + 2, 2).Value
w = Cells(lig + 3, 2).Value
If x = "" And y = "" And z = "" And w = "" Then
Exit Do
End If
lig = lig + 1
Loop
Range("A1:T" & lig).Select
Tableau1 = Selection.Value
Call RechercheFichier(Chemin, Fichier_à_Analyser)
Workbooks.Open Filename:=Chemin & "\" & Fichier_à_Analyser, local:=True
Windows(Fichier_à_Analyser).Activate
lig = 1
Do
x = Cells(lig, 1).Value
y = Cells(lig + 1, 1).Value
z = Cells(lig + 2, 1).Value
w = Cells(lig + 3, 1).Value
If x = "" And y = "" And z = "" And w = "" Then
Exit Do
End If
lig = lig + 1
Loop
'la feuille "11" est la feuille sur la quele on va faire la copie
Worksheets("11").Range("A1:T" & lig).Select
Tableau2 = Selection.Value
ActiveWindow.Close SaveChanges:=False
ReDim Tableau3(UBound(Tableau1, 1), 10)
Windows(Fichier_analyse).Activate
k = 0
For i = LBound(Tableau1, 1) To UBound(Tableau1, 1)
k = k + 1
Tableau3(k, 1) = Tableau1(i, 1)
For j = LBound(Tableau2, 1) To UBound(Tableau2, 1)
'copier toute la colonne C de la feuille 11 dans la colonne E de notre feuille du classeur ouvert
Tableau3(k, 5) = Tableau2(j, 3)
Next j
Next i
lig = 1
For i = LBound(Tableau3, 1) + 1 To UBound(Tableau3, 1)
Cells(lig, 5).Value = Tableau3(i, 5)
lig = lig + 1
Next i
Beep
Application.ScreenUpdating = True
End Sub |