+ Reply to Thread
Results 1 to 9 of 9

Populating a UserForm ListBox with all Open workbooks

  1. #1
    Registered User
    Join Date
    05-29-2013
    Location
    IL, USA
    MS-Off Ver
    Excel 2010
    Posts
    27

    Populating a UserForm ListBox with all Open workbooks

    I am trying to populate a ListBox in a UserForm with all the open workbooks on a desktop.

    Here is what I have so far. I think I'm getting caught at the ".AddItems" portion.

    Any and all help is greatly appreciated.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by JoshExcel; 03-09-2014 at 09:34 PM. Reason: SOLVED

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Populating a UserForm ListBox with all Open workbooks

    Hi,

    This code works for me in Excel 2010. See the attached...

    Could you please upload your workbook
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-29-2013
    Location
    IL, USA
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Populating a UserForm ListBox with all Open workbooks

    WorkBookUpdater.xlsm

    AJ:

    Yours work for me as well.

    Above is my workbook.

    Thank you,

    Josh

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Populating a UserForm ListBox with all Open workbooks

    Weird, because I literally copied your code and pasted into a new workbook...

    Will let you know what I find

  5. #5
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Populating a UserForm ListBox with all Open workbooks

    Your ListBox is called WkbkChoicesListBox, not WkbkListBox

  6. #6
    Registered User
    Join Date
    05-29-2013
    Location
    IL, USA
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Populating a UserForm ListBox with all Open workbooks

    Well, how silly was that?

    Thanks AJ!!!!

    Can you see where the wbChoice doesn't like to be given the value of WkbkChoicesListBox.Value?

    Or is the trick there to call it as a String, not a Workbook?

    The idea is that I want to modify the chosen workbook. So, I'd like to Activate it then do some column inserts, some formula copying, etc....

    Thank you,

    Josh

  7. #7
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Populating a UserForm ListBox with all Open workbooks

    Use this code:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-29-2013
    Location
    IL, USA
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Populating a UserForm ListBox with all Open workbooks

    Rock on! AJ, you're my hero for the evening.

    Thank you,

    Josh

  9. #9
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Populating a UserForm ListBox with all Open workbooks

    Hahaha you're welcome

    Please don't forget to mark this thread as solved, and please click on the * next to my post to say thanks

+ 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. two listbox populating on userform for chartrange
    By kmsoni in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2011, 11:36 AM
  2. listbox populating on userform
    By kmsoni in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-23-2011, 11:18 AM
  3. Populating UserForm TextBoxes from ListBox results
    By AGrace in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-15-2010, 03:07 PM
  4. Populating a userform listbox from a database
    By James_B in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-12-2010, 02:16 PM
  5. Fill A Userform Listbox With Names OF All Open Workbooks
    By JR@SGC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2007, 05:38 AM

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