Thanks for that. I have had a look and understand the code to do it but I am having trouble applying it to my code.