Thank you both for your replies. @TMS, this appears to work beautifully, thanks so much, hopefully this will help me produce a nice clean code.