Populating listbox from network directory

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to have a listbox on a userform populate with the contents
(names of workbooks) of a network directory? I know it's possible in VB, but
I can't figure out how to do this in VBA.

Thanks, Lee
 
An example of one way to do it:

Private Sub UserForm_Initialize()
Dim FName As String
FName = Dir("c:\files\*.xls")
While FName <> ""
ListBox1.AddItem FName
FName = Dir
Wend
End Sub

--
Jim Rech
Excel MVP
| Is it possible to have a listbox on a userform populate with the contents
| (names of workbooks) of a network directory? I know it's possible in VB,
but
| I can't figure out how to do this in VBA.
|
| Thanks, Lee
 

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

Back
Top