Populate a treeview control in Excel 2010 recursively
Posted on 2012-03-22
I have a two lists in excel (named ranges) :
NamedRange1: called taskIDs - has two fields
NamedRange2: called taskRelationships - has two fields
Both named ranges are dynamic named ranges where I want to refresh data into and re-populate the treeview when ever I need to.
I need to build/populate my treeview control with a recursive hierarchy.
taskIDs (named range)
PD0000 Product Data Maintenance
PD1000 Product Data
PD2000 Production Data
PD1010 New Product
PD1020 New product branch
PD3000 Product Costing
taskRelationships (named range)
and so on; the task relationships may be several levels deep which I am trying (desperately) to build using some sort of recursive vba code.
So the treeview needs to look like:
PD0000 - Product Data Maintenance
PD1000 - Product Data
PD1010 - New Product
PD1020 - New product branch
PD2000 - Production Data
PD3000 - Product Costing
I would appreciate any help anyone can offer, as it is doing my head in.
I hope this is clear enough to describe my issue.
Thanks in advance for any help.