No offence was intended. If any was taken, I apologise. I was also being light hearted as that monster is impossible to follow. Rather than trying to dissect it, a sample file and a definition of your criteria would be much more useful.