Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi to All,
This macro gets the name of the files in a folder "My Documents" to a excel sheet, can it be improved/altered to get the name of the sub folders in it? Regards, Cecil Sub FileListing() Dim oFSO As Object Dim oFolder As Object Dim oFile As Object Dim a As Long Dim sOld As String Set oFSO = CreateObject("Scripting.FileSystemObject") Set oFolder = oFSO.GetFolder("C:\My Documents") a = 2 For Each oFile In oFolder.Files sOld = oFile.Name Range("A" & a) = sOld a = a + 1 Next oFile End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
create a file list from a folder? | Excel Discussion (Misc queries) | |||
How do I print a LIST of documents in a folder | Excel Discussion (Misc queries) | |||
folder list | Excel Programming | |||
list Workbooks in Current Folder | Excel Programming | |||
How to get the list of files in a folder | Excel Programming |