+ Reply to Thread
Results 1 to 3 of 3

Treeview Issues in VBA/Excel 2010

  1. #1
    Registered User
    Join Date
    02-03-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    2

    Treeview Issues in VBA/Excel 2010

    Hi all

    I've posted below a subroutine I've written that takes values from an Excel worksheet range and (should) add them to a treeview. There are three levels to the treeview, which the If statement sorts out for me depending on the cells next to the range in the Excel worksheet. Stepping through the code shows that the range is working fine, i.e. 'parentText' is being set to the what I'd expect, etc.

    When I run the subroutine, however, the userform pops up without a populated treeview even though steppin through the code suggests to me that it has populated just fine.

    Does anyone have ideas on what might be the cause of this? I'm fairly new to VBA and may well be doing something daft!

    Thank you in advance for your time.

    Alex

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    02-03-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Treeview Issues in VBA/Excel 2010

    Looks like I was doing something stupid. I've added "Userform2." to the start of
    Please Login or Register  to view this content.
    on line 16 and it works. Thanks to all who read my post!

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Perhaps you should have the code for populating the treeview in the userform's Initialize event?
    If posting code please use code tags, see here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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