voila j'importe des données d'un fichiers texte avec la macro ci dessous,
mais lorsque ces données ci sont importées (LDV121_520 Mod 01/11 20:52 CJ LDV 01/11 00:25)
la date est transformé en 11/1/09 0:25
code
une petite idée?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 Dim ligne As String, strFullName, i As Long Sheets("aller").Select Cells.Select Selection.ClearContents strFullName = Application.GetOpenFilename("Fichiers textes (*.txt),*.txt", , _ "Sélectionnez un fichier aller:") Open strFullName For Input As #1 Do While Not EOF(1) Do While (Not EOF(1)) And (i < 65536) i = i + 1 Input #1, ligne Cells(i, 1).Value = ligne Loop If i < 65536 Or EOF(1) Then Exit Do i = 0 Worksheets.Add 'Ajoute une feuille si fichier text >65536 lignes Loop Close #1 Range("A:A").TextToColumns Destination:=Range("A1"), _ DataType:=xlDelimited, _ TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, _ Tab:=True![]()
Partager