Bonsoir à tous
J'aimerais adapter ce code Vba avec mon nouveau projet de gestion
Le code Vba de gmb (et je l'en remercie à l'occasion) sert à
Afficher seulement les clients non payés et non doublant
Je joins le fichier et le code Vba c'est plus facile à comprendre.
Le code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Clients As Object
Dim Cel As Range
If Target.Count > 1 Then Exit Sub
If Target.Address = "$A$2" Then
Set Clients = CreateObject("Scripting.Dictionary")
For Each Cel In Range("B14:B" & Cells(Rows.Count, "B").End(xlUp).Row)
If Cel <> "" And Cel.Offset(, 3).Value = "Non Payé" Then
Clients(Cel.Value) = Cel.Value
End If
Next Cel
With Target.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=Join(Clients.Keys, ",")
End With
End If
End Sub
Merci d'avance pour vos réponses.
A très bientôt
« Amicalement. »