Sub Eclater()
Dim tablo, i&, x$, j%, t1 As Boolean, t2 As Boolean
With Range("E1", Range("E" & Rows.Count).End(xlUp))
tablo = .Resize(, 2) 'matrice, plus rapide, au moins 2 éléments
For i = 1 To UBound(tablo)
x = Application.Trim(tablo(i, 1)) 'SUPPRESPACE
For j = Len(x) - 1 To 2 Step -1
If Mid(x, j, 1) = " " Then
t1 = IsNumeric(Mid(x, j - 1, 1))
t2 = IsNumeric(Mid(x, j + 1, 1))
If t1 And t2 Then
x = Left(x, j - 1) & Mid(x, j + 1) 'suppression
ElseIf Not t1 And Not t2 Then
x = Left(x, j - 1) & Chr(160) & Mid(x, j + 1) 'remplacement
End If
End If
Next j
tablo(i, 1) = x
Next i
'---restitution et éclatement---
Application.ScreenUpdating = False
.Value = tablo
.TextToColumns .Columns(3), xlDelimited, Space:=True, DecimalSeparator:="." 'commande Convertir
Columns("F").Cut Columns(Cells.Find("*", , xlValues, , xlByColumns, xlPrevious).Column + 1) 'couper-coller
.Resize(, 10).NumberFormat = "#,##0.00" 'format nombre
.Resize(, 10).EntireColumn.AutoFit 'ajustement largeur
.EntireColumn.Resize(, 2).Delete 'supprime les colonnes E et F
End With
End Sub
Sub RAZ()
Sheets("Mémorisation").[A:J].Copy [E1]
End Sub