Dear Alan,
Thanks for all the explanation and time to have look at the macro.
The code I posted was from the Excel group on this forum only and that is the reason I posted it initially on the Word and then later on the Excel Forum.

I did a search on Google before posting the problem on this forum and unfortunately could not find a suitable solution.
This was the one which was suiting my requirement, which is not working now.

I would rather wait for your free time and see what you come up with.

Thanks once again.