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
| Sub DONNEES_OCTOBRE()
'
X = 112
Do While Cells(X, 1) <> "99999"
Set c = Cells(X, 3)
Cells(X, 4).Value = c
With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\FREZZASE\Bureau\DCS\FEUILLES ROSES\10-2008\TOT"
.FileType = msoFileTypeExcelWorkbooks
.Filename = c
If .Execute > 0 Then
Workbooks.Open Filename:=.FoundFiles(1)
Workbooks("CHIFFRES RAPPORT TEST2.xls").Worksheets("DONNEES").Cells(X, 5).Value = Cells(21, 7).Value
Workbooks("CHIFFRES RAPPORT TEST2.xls").Worksheets("DONNEES").Cells(X, 6).Value = Cells(23, 7).Value
Workbooks("CHIFFRES RAPPORT TEST2.xls").Worksheets("DONNEES").Cells(X, 7).Value = Cells(25, 7).Value
For Each w In Workbooks
If w.Name <> ThisWorkbook.Name Then
w.Close savechanges:=False
End If
Next w
Else: MsgBox "Pas de fichier trouvé pour " & c
End If
End With |
Partager