You should be thinking about "recursion" here.. where your function calls itself when it encounters a KEY to enumerate the SubKEYs. When there are no more SubKEYs, you enumerate the Values.

Recursion is a fairly simple implementation, but can be an intimidating concept if you haven't used it before.

Jens has a great example of recursion in his DirList UDF that could point you in the right direction.

Give that a look, and pop back if you need more help.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D