First of all, good job in figuring out how to run the macro, I see that I neglected to finish the instructions. There are a few ways to run the macro, you can press F5 from within the editor, or go back to the Excel sheet, press Alt-F8, select CountPairs, and click Run.
The probable reason you got the error is due to having all the order numbers instead of blank lines (your issue 2). My macro looked for the blank lines. To fix that, just change this line:
VBA Code:
If MyTab(r2, 1) <> "" Then Exit For
to
VBA Code:
If MyTab(r2, 1) <> MyTab(r1, 1) And MyTab(r2, 1) <> "" Then Exit For
It'll work either way now.
Another possible issue could arise based on the number of product numbers you have. How many product numbers do you have? If you have 1000 items, the number of possible pairs is 1000*999 = 999,000 which is quite a lot. So maybe instead of the whole list, you just want the top 100 pairs? Or do you think that will be an issue?
Your issues 1 and 3 probably won't cause problems. Let me know if this works for you.