我想有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
修訂,感謝你的幫助,先生,我現在想知道爲什麼我收到此錯誤,謝謝!
什麼不工作/有什麼錯誤? –