+ Reply to Thread
Results 1 to 3 of 3

Transfer ALL nodes from a UserForm TreeView into a TreeView on a worksheet with VBA

  1. #1
    Registered User
    Join Date
    07-24-2015
    Location
    Toledo, OH
    MS-Off Ver
    Microsoft Office 2010
    Posts
    85

    Transfer ALL nodes from a UserForm TreeView into a TreeView on a worksheet with VBA

    Simple question that apparently has no simple answer: is it possible to transfer ALL of the nodes, parent, child or otherwise, and their arranged structure, from a userform treeview to a treeview on a worksheet?

    I have a userform where people can build their own categories and subcategories in a treeview control, and once they've done all this, I need them to be able to save what they did somehow. I cannot use the Clone thing because it only deals with the parent nodes, and I need every single node to be transferred.

    I'd be happy to copy the treeview if that would work, or something else. The end result just needs to be an exact replica of the userform treeview, placed on a worksheet in the workbook. Please tell me that this is possible. It seems ridiculous that it wouldn't be. But the internet is sadly lacking in regard to Treeviews in Excel. Every search I've run pretty much only pops up stuff for C# or Access. Help!
    Last edited by Jerbinator; 09-04-2015 at 07:54 AM. Reason: typo in the title

  2. #2
    Forum Contributor
    Join Date
    09-03-2015
    Location
    IE
    MS-Off Ver
    2003 - 2016
    Posts
    258

    Re: Transfer ALL nodes from a UserForm TreeView into a TreeView on a worksheet with VBA

    Not sure if you mean you want to Export to a TreeView control on a worksheet, or just export the data to a worksheet.

    If the latter, I downloaded a marvellous bit of code from here to load a 'treeview' (actually just a formatted tree like list on a worksheet) to a treeview.

    I also needed to export that data back to a worksheet - so I used the example to learn the various properties of a treeview.

    Attachment contains both the original code from the example to import from and Excel sheet and my procedure to Export back to an excel sheet.
    Attached Files Attached Files
    Last edited by grimes0332; 09-03-2015 at 04:44 PM.

  3. #3
    Registered User
    Join Date
    07-24-2015
    Location
    Toledo, OH
    MS-Off Ver
    Microsoft Office 2010
    Posts
    85

    Re: Transfer ALL nodes from a UserForm TreeView into a TreeView on a worksheet with VBA

    This is beautiful, and it works perfectly! I'm going to be spending the next several days figuring out why it works, but I'm definitely going to use it whether I can figure it out or not. I added a blip of code in there so that when the user exports the data to the worksheet, I get an automated email telling me they did it, and then I can go in and update the infrastructure with their new data. Brilliant! Thank you!

+ 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. Refresh Treeview on UserForm
    By zplugger in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-17-2015, 09:10 AM
  2. Search box on Userform Treeview
    By zplugger in forum Excel General
    Replies: 21
    Last Post: 01-15-2015, 08:28 AM
  3. [SOLVED] UserForm Treeview
    By zplugger in forum Excel General
    Replies: 8
    Last Post: 01-08-2015, 08:03 AM
  4. [SOLVED] Expand TreeView nodes
    By zplugger in forum Excel General
    Replies: 5
    Last Post: 01-08-2015, 07:57 AM
  5. [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
  6. 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
  7. How to use a Treeview control in a UserForm
    By rich534714 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-19-2007, 10:46 AM

Tags for this Thread

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