k, posting the code as UDF.
_________________________
!

download KiXnet