DOH! Thanks Howard. We have so many UDFs that I guess we sometimes forget what they all do.

But Maciep's code does appear to fit the bill as well in my simple tests.