我想有2个列表框,1与一堆值和一个与另一堆值,我想将它们添加到第三个列表框,然后删除所有的匹配值,2 Listboxes into 1,然后删除匹配值VBA
这里是我的代码,我走到这一步,
For i = 0 To (ListBox1.ListCount - 1)
ListBox3.AddItem (ListBox1.List(i))
Next
Dim qstring As String
For i = 0 To (ListBox2.ListCount - 1)
qstring = ListBox1.List(i)
With Me.ListBox3
'Loop through combobox
For b = 0 To .ListCount - 1
If .List(b) = qstring Then
strFound = True
Exit For
End If
Next b
'Check if we should add item
If Not strFound Then .AddItem (qstring)
End With
Next
修订,感谢你的帮助,先生,我现在想知道为什么我收到此错误,谢谢!
什么不工作/有什么错误? –