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 31
| Option Explicit
Option Base 1
Sub trier()
'un grand Merci à PARITEC de exceldownloads
Dim i&, fin&, t, x&, ref$, a&, aa, tp$, n, val#
tp = Timer
With Feuil1
fin = .Range("A" & Rows.Count).End(xlUp).Row
aa = .Range("A1:A" & fin)
ReDim Preserve aa(UBound(aa), 4)
For i = 1 To UBound(aa)
t = Split(aa(i, 1)): x = UBound(t)
aa(i, 1) = aa(i, 1)
aa(i, 2) = t(0) & t(1)
For a = 3 To x - 1
ref = ref & t(a) & " "
Next a
aa(i, 3) = ref
aa(i, 3) = LCase(aa(i, 3))
aa(i, 4) = t(x)
'<==============ajout de ces 3 lignes pour 0.00==========================>
n = Split(t(x), ".")
val = n(0) & "," & Mid(n(1), 1, 2)
aa(i, 4) = val
'<========================================================================>
Erase t: x = 0: ref = ""
Next i
.Range("A1").Resize(UBound(aa), UBound(aa, 2)) = aa
End With
MsgBox "Traitement réalisé en " & Format(Timer - tp, "0.00 s") |