Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim plage As Range, a, e, liste$
Set plage = [A2:A22] 'plage à adapter
a = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20) 'liste à adapter
If Intersect(ActiveCell, plage) Is Nothing Then Exit Sub
For Each e In a
liste = liste & "," & e
Next
liste = liste & "," 'pour encadrer
For Each e In plage
liste = Replace(liste, "," & e & ",", ",")
Next
With ActiveCell.Validation
.Delete
If liste <> "," Then .Add xlValidateList, Formula1:=Mid(liste, 2, Len(liste) - 1)
End With
End Sub