Traverse treeview bottom to top

R

RB Smissaert

Using Excel 2002.
Could anybody give me an example how to traverse a treeview from bottom to
top?
It has to start at a given node and it has to move through the treeview has
it appears on the screen.
In other words the order of the nodes is with increasing distance from the
bottom of the application.
I have a recursive function that moves top to bottom, but I can't figure out
the other way round.
Thanks for any assistance.


RBS
 
P

Peter Beach

Hi,

I think the answer is "with considerable difficulty". The problem is that
when you pop up to the .Parent node, you then have to traverse back down the
tree again to get the item immediately above the "target" item.

Given that you've got it working from top to bottom (which does lend itself
to effiicient recursion), why don't you use that code and just reverse the
order when you've finished?

Just a thought,

Peter Beach
 
R

RB Smissaert

Good thought.
I could traverse down, store the nodes in an array and use that to go the
other way.
Will give that a go.

RBS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top