Sub MAJ_Compte()
Dim Rep As String, Fichier As String
NomPrinc = ActiveWorkbook.Name
NomPrincOnglet = ActiveSheet.Name
Dim ws As Worksheet
Chemin = InputBox("Répertoire de mise à jour", "Seléction du chemin d'accès")
Fichier = Dir(Chemin & "\*.*")
Application.ScreenUpdating = False
Application.DisplayAlerts = False
'------------------------------------------------------------------------------------------------------------------------
Do While Fichier <> ""
Workbooks.Open Filename:=Chemin & "\" & Fichier, UpdateLinks:=0
ActiveWorkbook.Sheets("Kosten_Costs").Activate
With activeWorkbooks
Range("aa10").Select
ActiveCell.FormulaR1C1 = _
"=IF(AND(ISNUMBER(&'D10'&*1),&'D10'&<>0),IF(ISERROR(VLOOKUP(&'D10'&*1,[Charges_A_Ignorer.xlsx]Feuil1!&'a1'&:&'a300'&,1,FALSE)),&'X'&,&''&),&''&)"
Range("AA10").Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
'Range("AA10").Select
' Range(Selection, Selection.End(xlDown)).Select
' Selection.Copy
' Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
' :=False, Transpose:=False
Range("d10").Select
ActiveWorkbook.Save
ActiveWindow.Close
Fichier = Dir
End With
Loop