Bonjour,
Je n'arrive pas à afficher les fichiers d'un dossier (il y en a beaucoup) avec pour exemple :
123-Toto-titi.xls
789-Toto-tata.xls
589-Toto-titi.xls
888-Toto-tata.xls
Je voudrais récupérer uniquement les fichiers avec -tata.xls
J'ai juste récupéré ceci sur un site mais je crains qu'il est plutôt "Lourd" et pas complet.
Dim Tbl() As String
Dim I As Integer
Dim Chemin As String
Columns("A:A").Select
Selection.ClearContents
Range("A1").Select
Chemin = Dossier
Tbl = EnumFichiers(Chemin)
If Not (Not Tbl) Then
For I = 1 To UBound(Tbl)
Cells(I, 1) = Left(Tbl(I), InStrRev(Tbl(I), ".") - 1)
Cells(I, 1).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
Chemin & "/" & Tbl(I), TextToDisplay:=Tbl(I)
Next I
Merci pour votre aide.
Eric.L