hi
I have a the following
Dim objFSO As Object
Dim objFolder As Object
Dim objFile As Object
Dim i As Integer
'Create an instance of the FileSystemObject
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Get the folder object
Set objFolder = objFSO.GetFolder("C:\file loction\find")
i = 5
'loops through each file in the directory and prints their names and path
For Each objFile In objFolder.Files
'print file name
Cells(i + 1, 3) = objFile.Name
i = i + 1
Next objFile
MsgBox "Done!"
which I believe I got from here, it is fantastic and does what I need, only thing I want to change is I would like it to have the information be populated in a Userform listbox rather than cells on a worksheet.
is there a easy way to change this??
the information is only visual, so I don't need to store the list information in the workbook and I would prefer the information to not go on to a particular worksheet, if I can help it
thanks for any help you can provided
I have a the following
Dim objFSO As Object
Dim objFolder As Object
Dim objFile As Object
Dim i As Integer
'Create an instance of the FileSystemObject
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Get the folder object
Set objFolder = objFSO.GetFolder("C:\file loction\find")
i = 5
'loops through each file in the directory and prints their names and path
For Each objFile In objFolder.Files
'print file name
Cells(i + 1, 3) = objFile.Name
i = i + 1
Next objFile
MsgBox "Done!"
which I believe I got from here, it is fantastic and does what I need, only thing I want to change is I would like it to have the information be populated in a Userform listbox rather than cells on a worksheet.
is there a easy way to change this??
the information is only visual, so I don't need to store the list information in the workbook and I would prefer the information to not go on to a particular worksheet, if I can help it
thanks for any help you can provided