The hint is in the "less than size of the collection" part of the error message because you are iterating up to and including that size:
for (i = 0; i <= ListBox3.Items.Count; i++)
It must be
for (i = 0; i < ListBox3.Items.Count; i++)
[EDIT]
As noted by Richard, your loop might skip items and you should iterating down starting at the last item.
[/EDIT]