Start by telling us what you want your code to do. Your description above doesn't seem to relate to this code, and it is impossible to understand this code without seeing your worksheet. See my comments below--I have a hard time believing this code indeed works.
When you want to provide code, paste it directly into your post, using CODE tags, instead of attaching a text file containing the code. I pasted your code below (and added appropriate indentation).
It's even better to provide your actual Excel file so we can run the code and be able to run it ourselves. See the yellow banner at the top of the page.
Bookmarks