1. Please do not quote entire posts, it makes the thread unreadable.

2.
Quote Originally Posted by ex123 View Post
I tried running the macro, but getting run time vba error.
You got the error in the example file? which error number in which line?

3. I'll have a look at the complete file.