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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top