Thats worked perfectly for me. Thanks for your help. A very usefull piece of code.