1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| Private Sub Oopt_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim i, a
If Button = 2 And Oopt.ForeColor = vbRed = True Then
Oopt.Value = False: Oopt.ForeColor = &H800000
With usf.ListBox1
For i = 0 To .ListCount - 1
If .List(i) = Sheets(1).Range(Split(Oopt.Tag, ":")(0)).Text Then .RemoveItem i: Exit For
Next
End With
With usf.ListBox2
If .ListCount <> 0 Then
For a = 1 To 2
For i = 0 To .ListCount - 1
If .List(i) = Ocheck.Caption Or .List(i) = Ocheckbis.Caption Then .RemoveItem i: Exit For
Next
Next
End If
End With
End If
Ocheck.Value = False: Ocheck.Caption = "": Ocheckbis.Value = False: Ocheckbis.Caption = ""
End Sub
Private Sub Ooptbis_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim i, a
If Button = 2 And Ooptbis.ForeColor = vbRed Then
Ooptbis.Value = False: Ooptbis.ForeColor = &H800000
With usf.ListBox1
For i = 0 To .ListCount - 1
If .List(i) = Sheets(1).Range(Split(Ooptbis.Tag, ":")(0)).Text Then .RemoveItem i: Exit For
Next
End With
With usf.ListBox2
If .ListCount <> 0 Then
For a = 1 To 2
For i = 0 To .ListCount - 1
If .List(i) = Ocheck.Caption Or .List(i) = Ocheckbis.Caption Then .RemoveItem i: Exit For
Next
Next
End If
End With
End If
Ocheck.Value = False: Ocheck.Caption = "": Ocheckbis.Value = False: Ocheckbis.Caption = ""
End Sub |