Re : convertir .dat en .xls
Re
Trouve déjà une macro sur le net ou sur le forum qui te fait la liste de tes fichiers sur une feuille et ensuite ce ne sera pas bien compliqué 🙂.
Voici ce que j'ai trouvé sur le forum :
La macro liste les fichiers
comment je les renommes ?
Merci
Sub test()
Dim Dossier As String
Dossier = ActiveWorkbook.Path
ListFilesInFolder Dossier, True
End Sub
Sub ListFilesInFolder(strFolderName As String, bIncludeSubfolders As Boolean)
' necessite d'activer la reference Microsoft Scripting RunTime
Static FSO As FileSystemObject
Dim oSourceFolder As Scripting.Folder
Dim oSubFolder As Scripting.Folder
Dim oFile As Scripting.File
Static wksDest As Worksheet
Static iRow As Long
Static bNotFirstTime As Boolean
If Not bNotFirstTime Then
Set wksDest = ActiveSheet
Set FSO = CreateObject("Scripting.FileSystemObject")
iRow = 3
bNotFirstTime = True
End If
Set oSourceFolder = FSO.GetFolder(strFolderName)
For Each oFile In oSourceFolder.Files
wksDest.Cells(iRow, 1) = oFile.ParentFolder.Path
wksDest.Cells(iRow, 2) = oFile.Name
iRow = iRow + 1
Next oFile
If bIncludeSubfolders Then
For Each oSubFolder In oSourceFolder.SubFolders
ListFilesInFolder oSubFolder.Path, True
Next oSubFolder
End If
End Sub