Sub ExportCsv()
Dim Plage As Object, oL As Object, oC As Object
Dim Tmp$, Sep$
Dim Fichier$, Chemin$, CheminFiche$, Nlig&
With Application
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlManual
End With
'Fichier = "Base" & ".csv"
Fichier = "Références matériels" & ".csv"
Chemin = ActiveWorkbook.Path & Application.PathSeparator
CheminFiche = Chemin & Fichier
Nlig = Cells(Rows.Count, 1).End(xlUp).Row
Sep = ","
Set Plage = Range("A2:K" & Nlig)
Open CheminFiche For Output As #1
For Each oL In Plage.Rows
Tmp = ""
For Each oC In oL.Cells
Tmp = Tmp & CStr(oC.Text) & Sep
Next
Print #1, Left(Tmp, Len(Tmp) - 1)
Next
Close
Set Plage = Nothing
MsgBox "Export Base Terminer", vbInformation, "Admin"
With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
.EnableEvents = True
.Goto [A1], True
End With
End Sub