Thank you dc42,

That worked perfectly!
I understand the composition of the code now with your example.