Solved

TreeView Component In Excel

Posted on 2007-11-21
2
706 Views
Last Modified: 2013-12-25
Trying to use treeview component within excel.   I was able to get this work for 1 set of Parent Child relationships.  
I need to build another treeview component to work off the first treeview component where when the user checks off Parent or child in the first tree the 2nd tree automatically finds the Children in the 2nd Tree.
ExAMPLE:

Tree 1                                       Tree2
X Parent1                                     X Child1
      XCHild1                                        SubChild2
      Child2                                          SubChild3
      Child3                                       Child2
0
Comment
Question by:Good5388
2 Comments
 
LVL 9

Expert Comment

by:dmang
Comment Utility
Hi there

Why not build int all in the same treeview?

regards
dmang
0
 
LVL 48

Accepted Solution

by:
jpaulino earned 500 total points
Comment Utility
Hi Good5388,

You can do a search in the other treeview (treeview2) and select the item. for the treeview1 add this code

Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
Dim myNode As Node
For Each myNode In TreeView2.Nodes
 If Node.Text = myNode.Text Then
   myNode.Selected = True
   Exit For
 End If
Next
End Sub

In order to see the selection you have to unhide the selection

TreeView1.HideSelection = False
TreeView2.HideSelection = False
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now