#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Import file list

Hi,

I want to know if it's possible to import a list of files in a given folder
to Excel. So, for example, I can have all the files in C:\documents\ listed
in column A in a worksheet. Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Import file list


I created a macro for another guy that wanted to do the same thing.
Here it is. Just enter your folder in cell A1 in the format
c:\windows\ making sure you put the \ at the end.

Sub myDIR()
myFolder = Range("A1").Value
x = 1
y = 1
Range("A2").Select
Selection = Dir(myFolder)
Do While y < ""
y = Dir
Selection.Offset(x, 0).Value = y
x = x + 1
Loop
End Sub


--
Mallycat
------------------------------------------------------------------------
Mallycat's Profile: http://www.excelforum.com/member.php...o&userid=35514
View this thread: http://www.excelforum.com/showthread...hreadid=560970

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Import file list

Cool thanks.

"Mallycat" wrote:


I created a macro for another guy that wanted to do the same thing.
Here it is. Just enter your folder in cell A1 in the format
c:\windows\ making sure you put the \ at the end.

Sub myDIR()
myFolder = Range("A1").Value
x = 1
y = 1
Range("A2").Select
Selection = Dir(myFolder)
Do While y < ""
y = Dir
Selection.Offset(x, 0).Value = y
x = x + 1
Loop
End Sub


--
Mallycat
------------------------------------------------------------------------
Mallycat's Profile: http://www.excelforum.com/member.php...o&userid=35514
View this thread: http://www.excelforum.com/showthread...hreadid=560970


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 47
Default Import file list

this post was very usefull,, can the code be altered to show what is in any
sub-directory of the start folder

"Mallycat" wrote:


I created a macro for another guy that wanted to do the same thing.
Here it is. Just enter your folder in cell A1 in the format
c:\windows\ making sure you put the \ at the end.

Sub myDIR()
myFolder = Range("A1").Value
x = 1
y = 1
Range("A2").Select
Selection = Dir(myFolder)
Do While y < ""
y = Dir
Selection.Offset(x, 0).Value = y
x = x + 1
Loop
End Sub


--
Mallycat
------------------------------------------------------------------------
Mallycat's Profile: http://www.excelforum.com/member.php...o&userid=35514
View this thread: http://www.excelforum.com/showthread...hreadid=560970


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
Weird File Open/Save As Behavior [email protected] Excel Discussion (Misc queries) 0 December 9th 05 02:26 AM
CSV file for inporting contact list from Hotmail to Gmail using Ex Jesterzone Excel Discussion (Misc queries) 2 August 21st 05 05:21 PM
Recently Used File List - 2002 Contains 'Temp' Files Keith972002 Excel Discussion (Misc queries) 0 July 26th 05 01:46 PM
Import Pipe Delimited File, Parse out certian Fields, create new f StarBoy2000 New Users to Excel 4 July 17th 05 07:36 AM
The 'Recently used file list' does not show up under the 'File' menu. David F Excel Worksheet Functions 4 June 6th 05 07:43 AM


All times are GMT +1. The time now is 01:14 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"