Thanks Glenn. I don't think that there is anything wrong with my scripts as most of the coding has been operational for years. But it will be well worth running the Sanity Udf to see what comes to light. I think that the main thing that I need to do with my UDF's is to write it as ShaneP suggested. The difference in reading comprehension is incredible - it is so much easier to follow which if goes with which end statement.

I will get on with this next week as I won't have time this week to do it.