Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo Fin
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("H3,H5,H7")) Is Nothing Then
Dim Chaine$, L%, N%
Select Case Target.Address
Case "$H$3": N = 2 ' cellcule appelante et N° colonne où s'effectue la recherche
Case "$H$5": N = 3 ' par ex si H5 alors la recherche s'effectue en colonne 3 donc C
Case "$H$7": N = 4
End Select
Chaine = ""
For L = 3 To Range("A65500").End(xlUp).Row
If Cells(L, N) = "x" Then Chaine = Chaine & Cells(L, "A") & ","
Next L
Chaine = Mid(Chaine, 1, Len(Chaine) - 1)
With Target.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=Chaine
End With
End If
Fin:
End Sub