Function Changement&(xplage As Range, xtype&)
Dim t, n&, j&, res&
t = xplage.Value
For j = 1 To UBound(t, 2)
If t(1, j) <> "" Then n = n + 1: t(1, n) = t(1, j)
Next j
If xtype < 0 Then
For j = 1 To n - 1: res = IIf(t(1, j) > t(1, j + 1), res + 1, res): Next
ElseIf xtype = 0 Then
For j = 1 To n - 1: res = IIf(t(1, j) <> t(1, j + 1), res + 1, res): Next
Else
For j = 1 To n - 1: res = IIf(t(1, j) < t(1, j + 1), res + 1, res): Next
End If
Changement = res
End Function