Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populating Userform ComboBox with worksheet names in XL2003 MAWII Excel Programming 0 August 9th 05 09:07 PM
Populating a ComboBox DirInfo Excel Programming 1 March 17th 05 10:03 PM
Populating ComboBox Methods Todd Huttenstine[_2_] Excel Programming 8 January 19th 04 12:14 AM
Populating Combobox Methods Todd Huttenstine[_2_] Excel Programming 10 January 18th 04 10:19 PM
Populating sheet names in combobox Todd Huttenstine[_2_] Excel Programming 3 December 21st 03 12:11 AM


All times are GMT +1. The time now is 02:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"