ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Can anyone help me Create Excel list of files in windows folders (https://www.excelbanter.com/excel-worksheet-functions/57659-can-anyone-help-me-create-excel-list-files-windows-folders.html)

solrac1956

Can anyone help me Create Excel list of files in windows folders
 
I had previously been able to create an Excel list of Windows Folders. I
seem to have lost that component in my personal memory. Can anyone help me.

Carlos E. Gutierrez


Chip Pearson

Can anyone help me Create Excel list of files in windows folders
 
Do you mean just a list of folders? Try the following code.
You'll need a reference to the Scripting Runtime Library.

Dim FSO As Scripting.FileSystemObject
Dim Fldr As Scripting.Folder
Dim Rng As Range

Set FSO = New Scripting.FileSystemObject
Set Rng = Range("A1")
For Each Fldr In FSO.GetFolder("H:\").SubFolders
Rng.Value = Fldr.Path
Set Rng = Rng(2, 1)
Next Fldr


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



"solrac1956" wrote in
message
...
I had previously been able to create an Excel list of Windows
Folders. I
seem to have lost that component in my personal memory. Can
anyone help me.

Carlos E. Gutierrez





All times are GMT +1. The time now is 03:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com