Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
Dim ItemDtC As ListItem, ItemCCl As ListItem
WsFact.Range("a1:l65536").AutoFilter
With WsDC.Range("c2:c65536")
Set cel = .Find(Item.SubItems(1), , , xlWhole)
If Not cel Is Nothing Then
premaddress = cel.Address
ListView2.ListItems.Clear
Do
Set ItemDtC = ListView2.ListItems.Add(Text:=cel.Offset(0, 0))
ItemDtC.SubItems(1) = cel.Offset(0, 1)
ItemDtC.SubItems(2) = cel.Offset(0, 2)
ItemDtC.SubItems(3) = Format(cel.Offset(0, 3), "0.00.-")
ItemDtC.SubItems(4) = Format(cel.Offset(0, 4) / 100, "0%")
ItemDtC.SubItems(5) = Format(cel.Offset(0, 5), "0.00.-")
ItemDtC.SubItems(6) = Format(cel.Offset(0, 6), "0.00.-")
Set cel = .FindNext(cel)
Loop While Not cel Is Nothing And cel.Address <> premaddress
End If
With WsFact.Range("b2:b65536")
Set c = .Find(cel.Offset(0, 0), , xlValues)
If Not c Is Nothing Then
premaddress = cel.Address
ListView3.ListItems.Clear
Do
Set ItemCCl = ListView3.ListItems.Add(Text:=c.Offset(0, 0))
ItemCCl.SubItems(1) = c.Offset(0, 2)
ItemCCl.SubItems(2) = Format(c.Offset(0, 8), "0.00.-")
ItemCCl.SubItems(3) = c.Offset(0, 5)
If Date = c.Offset(0, 9).Value Then
MsgBox " Le versement à été éffectué." & vbCrLf & "Veuillez procéder à la mise à jour.", , "LES MILLES MERVEILLES"
c.Offset(0, 9).ClearContents
c.Offset(0, 5) = Format(Date, "dd.mm.yyyy")
Else
Exit Sub
End If
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> premaddress
End If
End With
End With
Call Maj
End Sub