Cara, esse código aqui lista itens de um diretórios para um listbox em um form vba
Ve se ajuda
Dim fileList() As String
Dim fName As String
Dim fPath As String
Dim I As Integer
'define the directory to be searched for files
fPath = "C:"
'build a list of the files
fName = Dir(fPath & "*")
While fName <> ""
'add fName to the list
I = I + 1
ReDim Preserve fileList(1 To I)
fileList(I) = fName
'get next filename
fName = Dir()
Wend
'see if any files were found
If I = 0 Then
MsgBox "No files found"
Exit Sub
End If
'cycle through the list and add to listbox
For I = 1 To UBound(fileList)
Me.ListBox1.AddItem fileList(I)
Next
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 04/11/2010 5:37 pm