Sub convertir_baan()
Application.ScreenUpdating = False
derli = [A65000].End(xlUp).Row
Range("A1:A" & derli).Select
'supprime les premiers espaces
For Each cell In Selection: cell.Value = LTrim(cell): Next
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
ConsecutiveDelimiter:=True, Tab:=True, Space:=False, Other:=True, OtherChar:="|", _
FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), _
Array(6, 1), Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1))
'remplace texte numérique par nombre
For Each cel In Range("A1:M" & derli)
cel.Value = Replace(cel, ".", ",")
If IsNumeric(cel) And cel <> "" Then cel.Value = CDbl(cel)
Next
'remplace résultat par formule
For Each cel In Range("A1:A" & derli)
If cel = "Total:" Then
For col = 2 To 4
Cells(cel.Row, col).FormulaR1C1 = "=SUM(R[-31]C:R[-2]C)"
Next
Cells(cel.Row, 5) = ""
Cells(cel.Row, 11).FormulaR1C1 = "=SUM(R[-31]C:R[-2]C)"
End If
Next
Range("A1").Select
Dim R As Range
Dim var
Dim i&
Dim j&
Set R = ActiveSheet.UsedRange
var = R
For i& = 1 To UBound(var, 1)
For j& = 1 To UBound(var, 2)
var(i&, j&) = Trim(var(i&, j&))
Next j&
Next i&
R = var
End Sub