Sub Importer(ByVal fichier As String, Optional NomDuTableau As String)
'Dim ws As Worksheet
'
' Si fichier inexistant alors sortir
If Dir(fichier) = "" Then Exit Sub
'
' Création d'une nouvelle feuille
'Set ws = ThisWorkbook.Sheets.Add()
'
Dim i As Integer
i = 1
'cherche la dernière ligne sur la feuille "data"
Sheets("data").Select
Do While Cells(i, 1).Value <> ""
i = i + 1
Loop
With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & fichier, Destination:=Range(Cells(i, 1), Cells(i, 1)))
If NomDuTableau <> "" Then .Name = NomDuTableau
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
1, 1, 1, 1, 1, 1, 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
End Sub