Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nath,
One way Sub CreateFormsListBox() Dim FSO As Object Dim oFile As Object Dim oFiles As Object Dim oFolder As Object Dim i As Long Dim sPath As String Worksheets.Add.Name = "FileList" Set FSO = CreateObject("Scripting.FileSystemObject") sPath = "C:\MyTest" Set oFolder = FSO.GetFolder(sPath) Set oFiles = oFolder.Files For Each oFile In oFiles i = i + 1 ActiveSheet.Cells(i, "A").Value = oFile.Name Next oFile Range("A1").Select End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "nath" wrote in message ... Hi Can anyone help me with the code to get a list of the files and folders in a given path i.e. c:\ and return them back to an excel sheet. TIA Nath |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
temporary directory files | Excel Discussion (Misc queries) | |||
Files in a directory? | Excel Discussion (Misc queries) | |||
Load all files in a directory | Excel Discussion (Misc queries) | |||
Check if directory empty OR no of files in directory. | Excel Programming | |||
Open files in directory | Excel Programming |