PC Review


Reply
Thread Tools Rate Thread

How do I paste a set of folder NAMES into a set of cells?

 
 
=?Utf-8?B?SmVkaSBMZWJh?=
Guest
Posts: n/a
 
      12th Sep 2007
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 With Quote
 
 
 
 
Gord Dibben
Guest
Posts: n/a
 
      13th Sep 2007
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-ins>Directory
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
<(E-Mail Removed)> 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!


 
Reply With Quote
 
Guest
Posts: n/a
 
      13th Sep 2007
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" <(E-Mail Removed)> wrote in message
news:C17FDDA4-3C0F-4F27-BDE2-(E-Mail Removed)...
>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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulling file names & path from folder and putting them in cells Ren Microsoft Excel Programming 5 4th Mar 2008 09:38 AM
Re: How do I paste a set of folder NAMES into a set of cells? Microsoft Excel Misc 0 13th Sep 2007 08:56 AM
Can I insert a file or folder names in Excel cells? =?Utf-8?B?SW5zZXJ0aW5nIGZpbGUgb3IgZm9sZGVyIG5hbWVz Microsoft Excel Misc 1 6th Oct 2005 11:30 PM
Re: Copy/Paste in Excel prints highlighted cells and does not paste Debra Dalgleish Microsoft Excel Misc 0 30th Jul 2003 11:59 PM
Re: Copy/Paste in Excel prints highlighted cells and does not paste Dave Peterson Microsoft Excel Misc 0 30th Jul 2003 11:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:19 PM.