Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How do I paste a set of folder NAMES into a set of cells?

I have a set of folders that I will be using Excel to describe the contents
of them. I'd like to be able to paste the folder names into the spreadsheet
rather than re-type all of them. I'm pretty sure there's a way to do it, but
can't figure it out. Please help!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How do I paste a set of folder NAMES into a set of cells?

Several methods to accomplish this.......I like Tushar's best if importing to
Excel.

To add a "Print Directory" feature to Explorer, go to
this KB Article.

http://support.microsoft.com/default...EN-US;q272623&

Or you can download Printfolder 1.2 from.....

http://no-nonsense-software.com/freeware/

I use PF 1.2 and find it to be more than adequate with custom
features.

OR Go to DOS(Command) prompt and directory.
Type DIR MYFILES.TXT

All the above create a *.TXT file which can be opened in Notepad or
Excel.

One more method if you want to by-pass the *.TXT file and pull
directly to Excel is to use Tushar Mehta's Excel Add-in. This allows filtering
and sorting once you have the data in Excel.

http://www.tushar-mehta.com/ scroll down to Add-insDirectory
Listing.

Download the ZIP file and un-zip to your Office\Library folder.


Gord Dibben MS Excel MVP

On Wed, 12 Sep 2007 14:22:01 -0700, Jedi Leba
wrote:

I have a set of folders that I will be using Excel to describe the contents
of them. I'd like to be able to paste the folder names into the spreadsheet
rather than re-type all of them. I'm pretty sure there's a way to do it, but
can't figure it out. Please help!


  #3   Report Post  
Posted to microsoft.public.excel.misc
No Name
 
Posts: n/a
Default How do I paste a set of folder NAMES into a set of cells?

This returns a listing of subfolders and their subfolders, etc, from a root
directory.

Sub ListSubFolders()
Dim f As New Collection
Call GetSubfolders("C:\MyRoot", f)
Dim i As Integer
For i = 1 To f.Count
Range("A50000").End(xlup).Offset(1).Value = f(i)
Next
End Sub

Function GetSubfolders(ByVal sFolderRoot As String, ByRef cSubfoldersFound
As Collection)
Dim oFso As FileSystemObject
Set oFso = New FileSystemObject
Dim oSubfolder As Folder
Dim sFoldername As String
Dim nextrow As Long
For Each oSubfolder In oFso.GetFolder(sFolderRoot).SubFolders
sFoldername = oSubfolder.Path
cSubfoldersFound.Add sFoldername, sFoldername
Call GetSubfolders(oSubfolder, cSubfoldersFound)
Next
End Function

"Jedi Leba" wrote in message
...
I have a set of folders that I will be using Excel to describe the contents
of them. I'd like to be able to paste the folder names into the
spreadsheet
rather than re-type all of them. I'm pretty sure there's a way to do it,
but
can't figure it out. Please help!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a list of file names within a folder in Microsoft Ex Seablue Excel Discussion (Misc queries) 2 April 9th 07 08:44 PM
Need a macro to include file names in a folder to excel sheet anil Excel Discussion (Misc queries) 0 March 12th 07 09:10 AM
Combine several Names in one folder with if-formula Vic1978 Excel Discussion (Misc queries) 4 December 7th 05 12:38 PM
Can I insert a file or folder names in Excel cells? Inserting file or folder names in cells. Excel Discussion (Misc queries) 1 October 6th 05 11:30 PM
create a list of worksheet names (from a single folder, or open files) Drew Excel Discussion (Misc queries) 2 April 15th 05 04:58 PM


All times are GMT +1. The time now is 02:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"