Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Populating ComboBox with Folder Names
How do I fill a combo box with a list of folders in order to enter the folder
that is selected from that list? Ex.: Folders - Customer 1 Customer 2 Customer 3 Select - Customer 1 and enter into that folder upon selection to view and select a folder within Cutomer 1. Then, how do I fill a combo box with a list of names of Excel workbooks that are in a selected folder in the same manner as above? -- Tyrell Fickenscher Plant Manager / Agronomist |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Populating ComboBox with Folder Names
With Combobox1
.Additem "Customer 1" .Additem "Customer 2" 'etc. End With and Dim FSO As Object Dim sFolder As String Dim fldr As Object Dim Folder As Object Dim file As Object Dim Files As Object Set FSO = CreateObject("Scripting.FileSystemObject") Set this = ActiveWorkbook sFolder = Combobox1.Value If sFolder < "" Then Set Folder = FSO.GetFolder(sFolder) Set Files = Folder.Files For Each file In Files If file.Type = "Microsoft Excel Worksheet" Then Combobox2.Additem file.Name End If Next file End If ' sFolder < "" Set FSO = Nothing -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Tyrell" wrote in message ... How do I fill a combo box with a list of folders in order to enter the folder that is selected from that list? Ex.: Folders - Customer 1 Customer 2 Customer 3 Select - Customer 1 and enter into that folder upon selection to view and select a folder within Cutomer 1. Then, how do I fill a combo box with a list of names of Excel workbooks that are in a selected folder in the same manner as above? -- Tyrell Fickenscher Plant Manager / Agronomist |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Populating Userform ComboBox with worksheet names in XL2003 | Excel Programming | |||
Populating a ComboBox | Excel Programming | |||
Populating ComboBox Methods | Excel Programming | |||
Populating Combobox Methods | Excel Programming | |||
Populating sheet names in combobox | Excel Programming |