Useful bit of code--thanks!