If you see in my previous post when I got this code, i had even attached the sample file and the contributor wrote this code for me, the link is http://www.excelforum.com/excel-prog...47#post3048047