Solved

TreeView Component In Excel

Posted on 2007-11-21
2
714 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Expert Comment

by:dmang
ID: 20327995
Hi there

Why not build int all in the same treeview?

regards
dmang
0
 
LVL 48

Accepted Solution

by:
jpaulino earned 500 total points
ID: 20334373
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

717 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