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
| Sub Main()
Dim derniere_ligne As Integer
Dim derniere_colonne As Integer
Dim i As Integer
Dim j As Integer
Dim sortie As String
ActiveSheet.Range("A1").Select
derniere_ligne = ActiveCell.SpecialCells(xlLastCell).Row
derniere_colonne = ActiveCell.SpecialCells(xlLastCell).Column
Cells(1, 1).Select
Open g_fichier_csv For Output As #1
For i = 1 To derniere_ligne
sortie = ""
For j = 1 To derniere_colonne - 1
'Cells(i, tblColonne(j).NumberFormat = "yyyy-mm-dd"
'MsgBox Cells(i, j).Format, vbInformation, "TUTU"
sortie = sortie & Cells(i, j).Text & ";"
Next j
sortie = sortie & Cells(i, j + 1).Text
Print #1, sortie
Next i
Close #1
Application.ScreenUpdating = True
End Sub |
Partager