If this thread was just meant as code for others to use (rather than a request for some kind of assistance), the CodeBank would be the place to post it.

If that is the case, I recommend creating a new thread there (as this one is now rather cluttered with "irrelevant" posts), including the same info as there is in the first post, plus an explanation of what the code is used for.