With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;Y:\cuba\extraction\CUBA_NOMAD_20070921090733.txt", Destination:=Range( _
"A1"))
.Name = "CUBA_NOMAD_20070921090733"[COLOR="red"]à enlever car dàja défini code ci-dessus [/COLOR]
.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 = False
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(9, 1, 1, 1, 1, 9, 9, 9)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Range("D1").Select
ActiveCell.FormulaR1C1 = "=LEFT(RC[-1],8)"
Range("D2").Select
ActiveWindow.SplitRow = 17
ActiveWindow.Panes(3).Activate
Range("A18").Select
ActiveCell.SpecialCells(xlLastCell).Select
ActiveWindow.SmallScroll Down:=1
ActiveWindow.Panes(1).Activate
Range("D1").Select
Selection.Copy
Range("D2:D53957").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Columns("D:D").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("C:C").Select
Selection.Delete Shift:=xlToLeft
Columns("D:D").Select
Selection.Insert Shift:=xlToRight
Range("D1").Select
ActiveCell.FormulaR1C1 = _
"=DATE(LEFT(RC[-1],4),MID(RC[-1],5,2),RIGHT(RC[-1],2))" [COLOR="Red"]Formule format date de AAAAMMJJ en JJ/MM/AAAA[/COLOR]
Range("D1").Select
Selection.Copy
Range("D2:D53957").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Columns("D:D").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("C:C").Select
Selection.Delete Shift:=xlToLeft
Range("A1").Select
ActiveWindow.SplitRow = 0
End Sub