+ Reply to Thread
Results 1 to 7 of 7

Listbox to display files within a folder

  1. #1
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Listbox to display files within a folder

    I have a listbox in which I want to display files fom within a set number of folders, identified by typing the folder name into a textbox.

    The folders will all be in the same location and will be named by year (2013, 2014, 2015 etc.)

    I have a problem with the error handling when the typed folder name does not exist, and also the code I have been playing around with produces the file list ok apart from that I have to duplicate it for every year that will exist going forward....! Is there to dynamically change it??

    Please help

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: Listbox to display files within a folder

    -double post
    Last edited by GaidenFocus; 07-31-2013 at 11:36 AM.

  3. #3
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: Listbox to display files within a folder

    -double post
    Last edited by GaidenFocus; 07-31-2013 at 11:48 AM.

  4. #4
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Re: Listbox to display files within a folder

    Double post? Where?

    I'm not very good with vba and your function solution appears to me to one which populates a list in a worksheet. I just want the files to be displayed in a listbox on the userform.

  5. #5
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: Listbox to display files within a folder

    Take a look at this workbook and let me know if you need help integrating it into your current project
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Re: Listbox to display files within a folder

    I have attached what I'm working with, most of the coding has been removed to just leave the elements I'm having trouble with...

    The set combobox creates a defined number of sheets...

    The Month and Year comboboxes combine to display the files listed within folders dicated by the selections made in those comboboxes, i.e. Sep 2013 will display files shown in the folder "Sep" within folder "2013"...

    The listbox will list the relevant files for review (to make sure that all the relevant ones are present)and then allow me to select them all so that when the 'Create' button is pressed the following happens,

    The relevant sheets are created depending on the Set result.
    All the relevant files are opened from which data can be copied into the sheets created in the last step.

    I'm struggling with didplaying the files due to the combination of month and year and the error created if the folders have not yet been created...I thought it would be relatively straightforward....but alas, no.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Re: Listbox to display files within a folder

    Can anyone suggest a solution or am I going the wrong way about it?

+ 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] Add files to a ListBox from a User defind folder
    By klonbeck in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-19-2012, 08:20 PM
  2. Display all files on a specified path on a listbox/listview with icons
    By thisisgerald in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-02-2012, 10:19 AM
  3. Open folder to display files
    By leighmills33 in forum Excel General
    Replies: 2
    Last Post: 04-09-2010, 09:57 AM
  4. Replies: 1
    Last Post: 01-24-2006, 11:00 AM
  5. Replies: 1
    Last Post: 01-24-2006, 12:25 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