I've been given a piece of code which was exactly what I was looking for (more accurately what I asked for) and worked brillantly. I have pasted below.
I can quite openly say I don't understand most of it but I would be grateful if someone could provide a small amendment.
In effect the...