Bonjour Firstname...
OK compris...
Du coup, nouvelle version de la proc d'export :
Option Explicit
Sub ExportCSV()
Const cSep = ","
Dim plage As Range
Dim oRow As Range, oCell As Range
Dim oTS As Object, oFS As Object
Dim sFilename As String
Dim sBuffer As String
Dim oSheet As Worksheet
Dim lLastrow As Long
Dim lFirstCol As Long, lLastCol As Long
Dim aValues() As String, sValue As String, i As Integer
Set oSheet = ActiveSheet
lLastrow = oSheet.UsedRange.Rows.Count
lFirstCol = Letter2Number("T")
lLastCol = Letter2Number("AQ")
ReDim aValues((lLastCol - lFirstCol) + 1)
With oSheet
Set plage = .Range(.Cells(1, lFirstCol), .Cells(lLastrow, lLastCol))
End With
sFilename = ThisWorkbook.Path & "\" & "ExportToCRM_" & Format(Now(), "yyyymmdd-HHMM") & ".csv"
Set oFS = CreateObject("Scripting.FileSystemObject")
Set oTS = oFS.CreateTextFile(sFilename, False)
For Each oRow In plage.Rows
For i = 1 To oRow.Columns.Count
Set oCell = oRow.Cells(1, i)
sValue = Replace(oCell.Value, ",", "")
If Len(oCell.NumberFormat) > 0 Then
sValue = Format(sValue, oCell.NumberFormat)
End If
If sValue = "0" Then
sValue = ""
End If
aValues(i - 1) = sValue
Next
sBuffer = Join(aValues(), cSep)
oTS.WriteLine sBuffer
Next
oTS.Close
Set oTS = Nothing
Set oFS = Nothing
End Sub
Function Letter2Number(zLetter As String) As Long
'SOURCE: www.TheSpreadsheetGuru.com/the-code-vault
Letter2Number = Range(zLetter & 1).Column
End Function