+ Reply to Thread
Results 1 to 6 of 6

Expand TreeView nodes

  1. #1
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Expand TreeView nodes

    Is it possible to expand a selected node with a commandbutton on a userform,if so could
    it collapse with the same button?

    Z
    Last edited by zplugger; 01-09-2015 at 08:47 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Expand TreeView nodes

    Hi,

    Would you explain in more detail. What do YOU mean by a NODE? What do you mean by EXPAND (the node).
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Expand TreeView nodes

    Sorry
    What I mean is say you have the parent node with say 6 child nodes attached. I would like to expand all child nodes from selected parent node with a button.

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Expand TreeView nodes

    Are you talking about something like an Organizational Chart for a company.....1 Pres to 6 Vice Pres to 30 Directors etc.?
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Expand TreeView nodes

    You can use the Expanded property.

    In your example file add this code. When running select the VBA Code section in order to populate treeview with nodes that can be expanded.
    Select Root node and then double click the userform.


    Please Login or Register  to view this content.
    The same code can be used in a buttons click event.
    Cheers
    Andy
    www.andypope.info

  6. #6
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Expand TreeView nodes

    Thanks Andy
    Works like charm

+ 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] Error Whilst Updating Nodes On A Treeview
    By ajryan88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2013, 04:49 PM
  2. how to create collapse and expand treeview in Excel 2010
    By awarebase1 in forum Excel General
    Replies: 4
    Last Post: 01-29-2013, 06:14 AM
  3. Count Children of all nodes in a treeview
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-18-2010, 10:05 AM
  4. Shape Nodes
    By incjourn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2010, 03:53 PM
  5. Creating Nodes
    By Andy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-10-2005, 03:40 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