View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
asmenut asmenut is offline
external usenet poster
 
Posts: 59
Default Removing items from listbox

I have (2) listboxes (List_AddTo - List_AddFrom). I have populated List_AddTo
with values from a Spreadsheet range. The List_AddFrom listbox is initially
populated from via VBA. I am having difficulty removing items from
List_AddFrom when they match List_AddTo items:

'Validate List_AddFrom Listbox with List_AddTo listbox and remove items as
necessary
If List_AddTo.ListIndex = -1 Then Exit Sub
If List_AddFrom.ListIndex = -1 Then Exit Sub
If Not cbDupicates Then
For i = 0 To List_AddTo.ListCount - 1
For j = 0 To List_AddFrom.ListCount - 1
If List_AddTo.list(i) = List_AddFrom.list(j) Then
List_AddFrom.RemoveItem j
End If
Next j
Next i
End If

Any ideas as to what I am doing wrong?