Sub Macro1()
Range("A1:A" & [A65000].End(3).Row).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.Worksheets("Feuil1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Feuil1").Sort.SortFields.Add Key:=Range("A1:A" & [A65000].End(3).Row) _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Feuil1").Sort
.SetRange Range("A1:A" & [A65000].End(3).Row)
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
code = [A1]
For k = 2 To [A65000].End(3).Row
If code + 10 < Cells(k, 1) Then GoTo saute
If code + 1 < Cells(k, 1) Then
tx = tx & Chr(10) & code + 1
End If
saute:
code = Cells(k, 1)
Next
MsgBox tx
End Sub