Populate listBox

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
 
T

Tom Ogilvy

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