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

    Dim fso As Object, fld As Object, Fil As Object
    Dim SubFolderName As String
    Dim i As Integer
    Dim j As Integer
    Set fso = CreateObject("Scripting.FileSystemObject")
        Me.lboYear.Clear
        SubFolderName = "C:\2013"
    Set fld = fso.GetFolder(SubFolderName)
    For Each Fil In fld.Files
        i = i + 1
        Me.lboYear.AddItem Fil.Name
    Next Fil