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
| Sub ouvrir_fichiers()
Dim intLignes, i As Integer
Dim rep As String
rep = "C:\Users\mgely\Desktop\globalforum"
ChDir "C:\Users\mgely\Desktop\Excel"
monfichier = Dir("*.xls*")
While monfichier <> ""
Workbooks.Open monfichier
monfichier = Dir()
'feuille "Table_Tâches"
With monfichier
'calcul du nombre de lignes
FinLignes = Cells(65535, 1).End(xlUp).Row
'de la ligne 11 à la fin avec un pas de 2
For i = 11 To FinLignes Step 2
Selection.Copy
Windows("globalforum.xls").Activate
Rows("10:10").Select
ActiveSheet.Paste
Next i
End With
Wend
'Workbooks.Close
End Sub |