Bonjour, je n'arrive pas a modifier cette macro pour que la destination des infos soit en "feuil2".
Sub TheFileLister()
Dim TheFileSearcher As FileSearch
Dim i%, ThePath$, Z$
ThePath = "D:\DOSSIER\"
On Error Resume Next
Set TheFileSearcher = Application.FileSearch
With TheFileSearcher
.NewSearch
.Filename = "*.xls*"
.LookIn = ThePath
.SearchSubFolders = False
.Execute msoSortByFileName, msoSortOrderAscending
If .Execute > 0 Then
With .FoundFiles
For i = 1 To .Count
Z = Dir(.Item(i))
Sheets("Feuil2").Hyperlinks.Add Anchor:=Cells(i + 3, 2), Address:=ThePath & "\\" & Z, _
TextToDisplay:=Z
Next i
End With
Else
End If
End With
Set TheFileSearcher = Nothing
End Sub
Merci à vous, Géraldine
Sub TheFileLister()
Dim TheFileSearcher As FileSearch
Dim i%, ThePath$, Z$
ThePath = "D:\DOSSIER\"
On Error Resume Next
Set TheFileSearcher = Application.FileSearch
With TheFileSearcher
.NewSearch
.Filename = "*.xls*"
.LookIn = ThePath
.SearchSubFolders = False
.Execute msoSortByFileName, msoSortOrderAscending
If .Execute > 0 Then
With .FoundFiles
For i = 1 To .Count
Z = Dir(.Item(i))
Sheets("Feuil2").Hyperlinks.Add Anchor:=Cells(i + 3, 2), Address:=ThePath & "\\" & Z, _
TextToDisplay:=Z
Next i
End With
Else
End If
End With
Set TheFileSearcher = Nothing
End Sub
Merci à vous, Géraldine