Bonjour,
Désolé de t'avoir demandé ce que tu voulais faire alors que tu l'as bien stipulé dans le titre de ton post, un .csv
Voici le code qui va créer un .csv dans le même dossier que le classeur :
Sub ExportEnCSV()
Dim Lig As Long
Dim Col As Long
Dim I As Long
Dim J As Long
Dim K As Long
Lig = Cells(Rows.Count, 1).End(xlUp).Row
Col = Cells(2, Columns.Count).End(xlToLeft).Column
Open ThisWorkbook.Path & "\Planning porf.csv" For Output As #1
For J = 2 To Col Step 3: For I = 4 To Lig
If Cells(I, J).Value <> "" Then K = K + 1: Print #1, "Lecon04-" & Format(K, "000") & " | " & Format(Cells(3, J).MergeArea.Cells(1, 1).Value, "yyyy-mm-dd") & " " & Format(Cells(I, 1).Value, "hh:mm") & " | " & Cells(I, J).Value
If Cells(I, J + 1).Value <> "" Then K = K + 1: Print #1, "Lecon04-" & Format(K, "000") & " | " & Format(Cells(3, J).MergeArea.Cells(1, 1).Value, "yyyy-mm-dd") & " " & Format(Cells(I, 1).Value, "hh:mm") & " | " & Cells(I, J + 1).Value
If Cells(I, J + 2).Value <> "" Then K = K + 1: Print #1, "Lecon04-" & Format(K, "000") & " | " & Format(Cells(3, J).MergeArea.Cells(1, 1).Value, "yyyy-mm-dd") & " " & Format(Cells(I, 1).Value, "hh:mm") & " | " & Cells(I, J + 2).Value
Next I, J
Close #1
End Sub