View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
damorrison damorrison is offline
external usenet poster
 
Posts: 91
Default Populate combobox with folder names

I had found this code to show folder names that displays in a msgbox,
is it possible to get the list of folder names into a combobox?

---------------------------------------

Sub ListFolders()
Dim fs, f, f1, fc, s
Dim folderspec
folderspec = "C:\Excel\"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderspec)
Set fc = f.SubFolders
For Each f1 In fc
s = s & f1.Name
s = s & vbCrLf

Next
MsgBox s


End Sub


----------------------------------------

This is for excel 2000

Thanks