View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default 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