Bonjour,
voici un premier code à essayer et à adapater.
Pensez à adapater le chemin du fichier .csv
Sub Macro1()
ActiveWorkbook.Worksheets.Add
ActiveSheet.Name = "provi"
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Users\gpetit\Downloads\doc-a-importer.csv", Destination:=Range("$A$1")) 'Chemin à adapter
'.CommandType = 0
.Name = "doc-a-importer"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Range("A1:M100000").Select
Selection.Copy
Sheets("Feuille d'import").Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A2").Select
Sheets("provi").Select
Application.CutCopyMode = False
ActiveWindow.SelectedSheets.Delete
End Sub
A+