Inversion of an array that contains indices
Unfortunately I don't really know visual basic but I think that you will find it easy to grasp the idea (and implement it in any language) of the following java code:

int[] source = new int[]{2,0,1};
int[] dest = new int[source.length];
for (int i = 0; i &lt; source.length; i += 1) {
    dest[source[i]] = i;
}


The code runs at \$O(n)\$ time whereas if you search for every element you get \$O(n^2)\$ time.