View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson[_2_] Chip Pearson[_2_] is offline
external usenet poster
 
Posts: 95
Default File directory into a listbox

Richard,

Try something like

Private Sub CommandButton1_Click()
Dim FName As String
With Me.ListBox1
.Clear
FName = Dir("k:\files\*.csv")
Do Until FName = ""
.AddItem FName
FName = Dir()
Loop
End With
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Richard Edwards" wrote in message
...
All,

In listbox1 I am trying to retreive the contents of directory
"k:\files\*.csv" and am having real problems in doing this.

Can anyone give me the quick answer.

Thank you.

Richard