This is still not complete code. I don't see the EndFuction nor do I see where and how you call the UDF. Also, your vars ar all DIMmed local so how do you get the data ouside of the function?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.