bonjour,
Voici un modèle que tu peux appliquer
Sub db()
motcles = Array("txt", "xlsm")
With Application.FileDialog(msoFileDialogFolderPicker)
.Show
chemin = .SelectedItems(1) & "\"
End With
Set fso = CreateObject("scripting.filesystemobject")
Set dossier = fso.getfolder(chemin)
For Each i In dossier.Files
For n = 0 To UBound(motcles)
If InStr(1, i, motcles(n)) <> 0 Then Call traitement(i, n)
Next
Next
End Sub
Sub traitement(fichier, numtraitement)
Select Case numtraitement
Case Is = 0
MsgBox fichier & Chr(13) & " traitement 1"
Case Is = 1
MsgBox fichier & Chr(13) & " traitement 2"
End Select