ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Traverse treeview bottom to top (https://www.excelbanter.com/excel-programming/275130-traverse-treeview-bottom-top.html)

RB Smissaert

Traverse treeview bottom to top
 
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


Peter Beach

Traverse treeview bottom to top
 
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


"RB Smissaert" wrote in message
...
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




RB Smissaert

Traverse treeview bottom to top
 
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

"Peter Beach" wrote in message
...
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


"RB Smissaert" wrote in message
...
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






All times are GMT +1. The time now is 09:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com