Populate listBox

  • Thread starter Thread starter Hamster
  • Start date Start date
H

Hamster

Hi All

How do I go about populating a listbox. with file names from a directory. I
can do this in VB but can't find anything in excel


thank you
Phill
 
Dim sPath as String
Dim sFname as String
sPath = "C:\Myfolder\*.xls"
sFname = Dir(sPath)
Do while sFname <> ""
Listbox1.AddItem sFname
sFName = dir()
Loop
 
Back
Top