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 50
|
Sub Archives_txt()
Dim Fichiers As Variant
Dim Fichier_txt As Variant
Dim Directory As Variant
Fichiers = Range("N35").Value
Fichier_txt = Range("N36").Value
Directory = Worksheets("Admin").Range("C24").Value
'Enregistrement de la procédure
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;E:\Apli_Tex_Presse150bth\Archive\0000201635_0014.txt", Destination:= _
Range("$AB$70"))
' Je voudrais remplacer: E:\Apli_Tex_Presse150bth\Archive\ par Directory
' et 0000201635_0014.txt par "Fichier_txt"
.Name = "0000201635_0014"
'Je souhaiterais également remplacer "0000201635_0014" par "Fichier"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 20269
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub |
Partager