Can anyone help me Create Excel list of files in windows folders

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
(e-mail address removed)
 
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



message
news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top