Your welcome.

I don't have a "delete" UDF to hand (and I'm just off home), but I'm sure one will be along in a moment...

A couple of warnings if you are going to use these UDFs:
  • To keep it simple and fast, the pop/push is using the "high" end of the array as the top of the stack, not array subscript 0. Use Ubound() if you want to "peek" at the top of the stack.
  • To identify an empty stack the array is destroyed when the last element is popped. Be careful about referencing the stack especially in an array context - if you use an array reference on a depleted stack you will likely get a runtime error. This is the reason for the VarType() checks in the UDFs.