1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| Sub recup_extr()
'mise à vide de la feuille
Range("A2:AZ6500").Select
Selection.ClearContents
' Récupère l'emplacement du fichier
On Error GoTo 1
Dim finput As FileDialog
Set finput = Application.FileDialog(msoFileDialogFilePicker)
finput.InitialFileName = ThisWorkbook.Path & "\"
finput.AllowMultiSelect = False
finput.Show
chemintemp = finput.SelectedItems(1)
1:
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;chemintemp", Destination:=Range("$A$2"))
' "TEXT;D:\NOMENCLATURE\extNomISO.txt", Destination:=Range("$A$2"))
.Name = "extraction"
.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 = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub |
Partager