• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 723
  • Last Modified:

TreeView Component In Excel

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
Good5388
Asked:
Good5388
1 Solution
 
dmangCommented:
Hi there

Why not build int all in the same treeview?

regards
dmang
0
 
jpaulinoCommented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now