Sub Copie()
Dim MonRepertoire As String, fs As FileSearch, wb As Workbook, wb2 As Workbook
MonRepertoire = "C:\MesDossiers\LISTE_dossiers"
Set fs = Application.FileSearch
With fs
.NewSearch
.LookIn = MonRepertoire
.Filename = Range("B1").Value & "*" & ".xls"
If .Execute = 0 Then Exit Sub
Set wb = Workbooks.Open(.FoundFiles(1))
End With
Set wb2 = ThisWorkbook
wb.Sheets("Gestion dossiers").Range("E2:F3").Copy Destination:=wb2.Sheets("Feuil1").Range("L6:M7")
wb.Sheets("Gestion dossiers").Range("E2:F3").Copy Destination:=wb2.Sheets("Feuil1").Range("D6:E7")
Dim i As Integer
For i = 9 To 200
[COLOR="Red"]Windows("wb").Activate
If wb.Sheets("Gestion dossiers").Cells(1, i).Value >= 49 And wb.Sheets("Gestion dossiers").Cells(1, i).Value <= 30 Then[/COLOR]
Do
wb.Sheets("Gestion dossiers").Range("B&(i)").Copy Destination:=wb2.Sheets("Feuil1").Range("K1") ' copie le numéro de dossier de Bi dans la cellule K1
wb2.Sheets("Feuil1").Range("F7").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "Dossier :" & Range("K1")
wb2.Sheets("Feuil1").Range("Q7:R7").Select
ActiveCell.FormulaR1C1 = "Dossier :" & Range("K1")
Loop While i = 200
End If
Next
End Sub