I tried to comment as much as I could so it was clear WHAT each line of code accomplishes, that should aid as you try to decipher HOW it accomplihed that.

If that takes care of your need, please select Thread Tools from menu above and set this topic to SOLVED.