- Katılım
- 18 Mart 2012
- Mesajlar
- 19
- Excel Vers. ve Dili
- türkçe 2010
Merhaba bu kodun çalışıyor fakat bir kere düzgün çalışması için sonuna nasıl bir kod gerekiyor Next denedim bir kere çalıştı end if hiç çalışmadı.
ListBox1.MultiSelect = fmMultiSelectMulti
ListBox3.MultiSelect = fmMultiSelectMulti
For a = 0 To ListBox4.ListCount - 1
aa = ListBox4.List(a, 0)
For b = 0 To ListBox3.ListCount - 1
bb = ListBox3.List(b, 0)
For c = 0 To ListBox1.ListCount - 1
cc = ListBox1.List(c, 1)
If aa = bb And aa = cc Then
ListBox1.Selected(c) = True
ListBox3.Selected(b) = True
On Error Resume Next
If ListBox3.Selected(b) = True Then ListBox3.RemoveItem (b)
End If
Next
Next
Next
On Error Resume Next
For e = ListBox1.ListCount To 0 Step -1
If ListBox1.Selected(e) = True Then ListBox1.RemoveItem (e)
ListBox1.MultiSelect = fmMultiSelectMulti
ListBox3.MultiSelect = fmMultiSelectMulti
For a = 0 To ListBox4.ListCount - 1
aa = ListBox4.List(a, 0)
For b = 0 To ListBox3.ListCount - 1
bb = ListBox3.List(b, 0)
For c = 0 To ListBox1.ListCount - 1
cc = ListBox1.List(c, 1)
If aa = bb And aa = cc Then
ListBox1.Selected(c) = True
ListBox3.Selected(b) = True
On Error Resume Next
If ListBox3.Selected(b) = True Then ListBox3.RemoveItem (b)
End If
Next
Next
Next
On Error Resume Next
For e = ListBox1.ListCount To 0 Step -1
If ListBox1.Selected(e) = True Then ListBox1.RemoveItem (e)