edit: below composed prior to above post - apologies for the repetition within
I think with 4m cells to process you should be looking to work with VBA Arrays - the above routine would I think be quite slow on a large volume of data (even if you optimise App settings etc)
It's not clear if the ID# are sequential etc or not - using MarvinP's sample file but extended to a 2000 x 2000 matrix we could run something like:
That said there are plenty out there better at working with Arrays far more efficiently than I - the above takes around 10 seconds on my machine but that's with 4GB RAM etc... so it will fluctuate.
My guess is the better programmers around here will be able to improve upon that significantly - whilst also catering for the fact that the name table may not be in order or follow 1 to n pattern.
Note: the above also assumes all Number entries are valid - ie no missing names - again this can be catered for if necessary.
Bookmarks