re-bonjour,
en effet, j'ai mal compris la demande.
Option Explicit
Sub aargh()
Dim t, i&, cle$, dict, dl&, a, b, c
With Sheets("feuil1")
.Range("D:Z").Delete
dl = .Cells(Rows.Count, 1).End(xlUp).Row
Set dict = CreateObject("scripting.dictionary")
t = .Range("A1").Resize(dl, 1).Value
For i = 1 To dl - 2
'on prend 3 nombres consécutifs
a = t(i + 2, 1)
b = t(i + 1, 1)
c = t(i, 1)
If a = b Or a = c Or b = c Then
Else
cle = a & " " & b & " " & c
dict(cle) = dict(cle) + 1 'incrémente cette occurrence de 3 nombres
End If
Next i
'affichage du résultat
.Range("D1").Resize(dict.Count, 1) = Application.Transpose(dict.keys)
.Range("G1").Resize(dict.Count, 1) = Application.Transpose(dict.items)
.Range("D1").Resize(dict.Count, 4).Sort key1:=.Range("G1"), order1:=xlDescending, Header:=xlNo
.Range("D1").Resize(dict.Count, 1).TextToColumns Space:=True
End With
End Sub