Results 1 to 9 of 9

Populating a UserForm ListBox with all Open workbooks

Threaded View

  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.

    Private Sub CommandButton1_Click()
    
    WorkbookChoiceUserForm.Show
    
    End Sub
    Private Sub UserForm_Initialize()
    
        Dim wb As Workbook
        Dim wbs As Workbooks
        Dim wbText As String
    
        Set wbs = Application.Workbooks
    
        'Fill WkbkListBox
        With WkbkListBox
            For Each wb In wbs
                wbText = wb.Name
                WkbkListBox.AddItem wbText
            Next wb
        End With
    
    End Sub
    
    Private Sub ContinueButton_Click()
        
        Dim wbChoice As Workbook
        wbChoice = WkbkListBox.Value
        'Wanted to check my work, but not getting this far yet.
        Cells(1, 1).Value = wbChoice
    
    End Sub
    Last edited by JoshExcel; 03-09-2014 at 09:34 PM. Reason: SOLVED

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