That's brilliant exactly the sort of thing I was looking for. Thanks for your help and your example davesexcel!