Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
craigwojo
 
Posts: n/a
Default Import file names into cells


Hi everyone,

I need to take file names from directories on my hard dirve and import
the file name into a cell. I don't want to type all the file names
into each cell. Also if I add a file to the directory I would like it
to update the excel sheet and put the file in the correct place. If
the second part is hard to understand, forget about it, I really need
the first part of this question.

Thank you,
Craig


--
craigwojo
------------------------------------------------------------------------
craigwojo's Profile: http://www.excelforum.com/member.php...o&userid=13767
View this thread: http://www.excelforum.com/showthread...hreadid=274415

  #2   Report Post  
Don Guillett
 
Posts: n/a
Default

This macro will make a list of all files in "yourfolder". Change to suit. If
you only want excel files, uncomment the .filename line.

With Application.FileSearch
.NewSearch
.LookIn = "c:\YourFolder"
'.SearchSubFolders = True 'False
'.FileName = ".xls" 'Your file types
If .Execute 0 Then
For iCtr = 1 To .FoundFiles.Count
Cells(iCtr, 1).Value = .FoundFiles(iCtr)
Next iCtr
End If
End With


--
Don Guillett
SalesAid Software

"craigwojo" wrote in message
...

Hi everyone,

I need to take file names from directories on my hard dirve and import
the file name into a cell. I don't want to type all the file names
into each cell. Also if I add a file to the directory I would like it
to update the excel sheet and put the file in the correct place. If
the second part is hard to understand, forget about it, I really need
the first part of this question.

Thank you,
Craig


--
craigwojo
------------------------------------------------------------------------
craigwojo's Profile:

http://www.excelforum.com/member.php...o&userid=13767
View this thread: http://www.excelforum.com/showthread...hreadid=274415



  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

Craig

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

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 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.

As to the second part of mission........the updating part......I think you
would just have to re-import all filenames again from the folder.

Gord Dibben Excel MVP

On Mon, 1 Nov 2004 20:29:42 -0600, craigwojo
wrote:


Hi everyone,

I need to take file names from directories on my hard dirve and import
the file name into a cell. I don't want to type all the file names
into each cell. Also if I add a file to the directory I would like it
to update the excel sheet and put the file in the correct place. If
the second part is hard to understand, forget about it, I really need
the first part of this question.

Thank you,
Craig


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 can I import a text file into excel with each field as a sepe. [email protected] Excel Discussion (Misc queries) 8 January 18th 05 02:31 AM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM
VBA Import of text file & Array parsing of that data Dennis Excel Discussion (Misc queries) 4 November 28th 04 10:20 PM
import Lotus file to Excel Lotus to Excel HELP! Excel Discussion (Misc queries) 2 November 28th 04 04:26 PM
import csv file Patrick Excel Discussion (Misc queries) 2 November 27th 04 10:09 AM


All times are GMT +1. The time now is 12:58 AM.

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"