Bonjour tout le monde,
J'ai un problème. Avec se code, je copie un format "jj.mm.aaaa hh:mm:ss" mais au moment du collage, il inversse le moi et les jours
Je me retrouve avec 06.05.2017 23:13:52 alors que la base copier est 05.06.2017 23:13:52
Auriez vous une solution?
Merci d'avance
Sub LireCsv(NomFichier)
Dim Ar() As String
Dim LastLig As Long
Feuil4.Select
With Application
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlManual
End With
LastLig = Cells(Rows.Count, 1).End(xlUp).Row + 1 'LastLig est la dernière ligne remplie du fichier csv ouvert
Sep = ";"
Lig = LastLig
' -----------------------------------------
'On Error Resume Next
Open NomFichier For Input As #1
Do While Not EOF(1)
Line Input #1, Chaine
Ar = Split(Chaine, Sep)
Col = 1
If Lig <> 10 Then
On Error Resume Next
For X = LBound(Ar) To UBound(Ar)
If Col = 1 Then
Cells(Lig, Col).Value = Replace(Ar(X), ".", "/")
Else
Cells(Lig, Col).Value = CStr(Ar(X))
End If
Col = Col + 1
Next
End If
Lig = Lig + 1
Loop
Close #1
' -----------------------------------------
With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
.EnableEvents = True
.CutCopyMode = False
.Goto [A1], True
End With
End Sub