Bonjour,
Je galère avec un code tout simple.
Sans VBA, la formule est :
Franchement je ne sais pas trop si la synthaxe est correcte non plus.
Je veux bien un coup de main pour avancer.
Mon code entier si ca peut aider.
Merci pour votre aide.
Je galère avec un code tout simple.
Code:
ActiveCell.FormulaR1C1 = _
"=IF(AND(ISNUMBER(&'D10'&*1),&'D10'&<>0),IF(ISERROR(VLOOKUP(&'D10'&*1,[Charges_A_Ignorer.xlsx]Feuil1!&'a1'&:&'a300'&,1,FALSE)),&'X'&,&''&),&''&)"
Sans VBA, la formule est :
Code:
=si(et(estnum(a1*1);a1<>0);si(esterreur(recherchev(a1*1;[Charges_A_Ignorer.xlsx]Feuil1!$A:$A;1;faux));"x";"");"")
Franchement je ne sais pas trop si la synthaxe est correcte non plus.
Je veux bien un coup de main pour avancer.
Mon code entier si ca peut aider.
Code:
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
Merci pour votre aide.
Dernière édition: