+ Reply to Thread
Results 1 to 13 of 13

VBA TreeView nparent/nchild

  1. #1
    Forum Contributor
    Join Date
    02-17-2022
    Location
    europe
    MS-Off Ver
    2020
    Posts
    113

    VBA TreeView nparent/nchild

    Heys guys

    Been trying to work with Treeview Control recently not gonna lie it seen hard to work.

    Wanna make it something like this:

    CBDA (1)
    TBNE(1.1)
    CBTI(1.2)
    BSE(1.3)
    TBNU(1.4)

    Take a look into the workbook.

    Thank you for your time!

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    02-17-2022
    Location
    europe
    MS-Off Ver
    2020
    Posts
    113

    Re: VBA TreeView nparent/nchild

    Hey guys,

    Did some research, but not quite there, because I want to make the values show up, for example, its not showing dates in CBDA nodes, etc.

    I still need to have the values in each nodes..

    Would love some help here

    Please Login or Register  to view this content.

    Thanks
    Attached Files Attached Files

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: VBA TreeView nparent/nchild

    Please be patient.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Contributor
    Join Date
    08-19-2009
    Location
    UAE
    MS-Off Ver
    Excel 2016
    Posts
    167

    Re: VBA TreeView nparent/nchild

    Hello


    Please find attached, Hope this helps, i am not an expert, recently started using tree view. ( Thanks to this forum)

    Thanks
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    02-17-2022
    Location
    europe
    MS-Off Ver
    2020
    Posts
    113

    Re: VBA TreeView nparent/nchild

    Hey Jude,

    Thank you for your time and helping out.


    That's all on me to honest, I have some issue thinking about how build the Treeview control, but you just did what I said, so you did a great job

    After some time of thinking about correctly since in my mind was completly something different, because I had such a hard time thinking about how to build it, tried to make a tree myself, and took a picture of it to have an idea.

    Not sure If it's achievable, but I think it pretty much what I am trying to do. Sorry.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by THEVULGRIM; 09-15-2022 at 08:42 AM.

  6. #6
    Forum Contributor
    Join Date
    08-19-2009
    Location
    UAE
    MS-Off Ver
    Excel 2016
    Posts
    167

    Re: VBA TreeView nparent/nchild

    Hello,

    Find attached as you requested, the code was given by Forum Expert "WideBoyDixon" in this forum.

    I just tweaked it. Hope it helps

    Jude
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    02-17-2022
    Location
    europe
    MS-Off Ver
    2020
    Posts
    113

    Re: VBA TreeView nparent/nchild

    Quote Originally Posted by judeprem View Post
    Hello,

    Find attached as you requested, the code was given by Forum Expert "WideBoyDixon" in this forum.

    I just tweaked it. Hope it helps

    Jude

    Hello jude, that's awesome, really grateful about your help.


    I usually don't ask for that, but since it's new pretty into Treeview control, I would like to request you to add comments If you don't mind ofc.


    Thank for your time btw

  8. #8
    Forum Contributor
    Join Date
    08-19-2009
    Location
    UAE
    MS-Off Ver
    Excel 2016
    Posts
    167

    Re: VBA TreeView nparent/nchild

    Hello,

    What comment you are looking for?

  9. #9
    Forum Contributor
    Join Date
    02-17-2022
    Location
    europe
    MS-Off Ver
    2020
    Posts
    113
    Quote Originally Posted by judeprem View Post
    Hello,

    What comment you are looking for?
    I am asking for your readable explanation in the code, because I really wanna learn more about treeview haha ty again.

  10. #10
    Forum Contributor
    Join Date
    08-19-2009
    Location
    UAE
    MS-Off Ver
    Excel 2016
    Posts
    167

    Re: VBA TreeView nparent/nchild

    With Comments
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    02-17-2022
    Location
    europe
    MS-Off Ver
    2020
    Posts
    113

    Re: VBA TreeView nparent/nchild

    Hey jude,

    Thank you have an amazing weekend end!

  12. #12
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,386

    Re: VBA TreeView nparent/nchild

    Hi all,

    There is a simpler and more compact way of doing this. The code below is everything you need.
    See attachment too.


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JEC.; 09-17-2022 at 10:21 AM.

  13. #13
    Forum Contributor
    Join Date
    02-17-2022
    Location
    europe
    MS-Off Ver
    2020
    Posts
    113

    Re: VBA TreeView nparent/nchild

    Quote Originally Posted by JEC. View Post
    Hi all,

    There is a simpler and more compact way of doing this. The code below is everything you need.
    See attachment too.


    Please Login or Register  to view this content.
    Thank you, I marked it as solved, but would love not only for me, but for people also looking to learn, would love you to explain every line of your code. ty.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Transfer ALL nodes from a UserForm TreeView into a TreeView on a worksheet with VBA
    By Jerbinator in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2015, 07:52 AM
  2. [SOLVED] Treeview in VBA
    By devatu in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 08-25-2015, 07:44 AM
  3. TreeView Help
    By texanjohn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2009, 03:05 PM
  4. using a treeview
    By dadio25 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-18-2009, 12:07 PM
  5. Treeview Question
    By vqthomf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2006, 07:55 AM
  6. [SOLVED] TreeView
    By Stephen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2005, 02:05 PM
  7. TreeView Help
    By Tony in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-21-2005, 01:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1