Sub Probleme1()
Dim t, lig&, n, wf As WorksheetFunction: Set wf = Application.WorksheetFunction
Dim X, Y, test As Boolean
t = Timer
lig = 7
For n = 1 To 10000
X = Evaluate(wf.Substitute(Cells(lig, "C"), Chr(10), "+"))
Y = Evaluate(wf.Substitute(Cells(lig, "F"), Chr(10), "+"))
test = IIf(IsError(X), 0, X) <> IIf(IsError(Y), 0, Y)
Next
MsgBox Format(Timer - t, "0.00") & " x 10000 seconde"
End Sub
Sub Diff()
Dim t, lig&, n, test As Boolean
t = Timer
lig = 7
For n = 1 To 10000
test = MySum(Cells(lig, 3)) <> MySum(Cells(lig, 6))
Next
MsgBox Format(Timer - t, "0.00") & " x 10000 seconde"
End Sub
Function MySum(t$)
Dim i%, deb%
For i = 1 To Len(t) + 1
If deb = 0 And IsNumeric(Mid(t, i, 1)) Then deb = i
If deb And Not IsNumeric(Mid(t, i, 1)) Then
MySum = MySum + CDbl(Mid(t, deb, i - deb))
deb = 0
End If
Next
End Function