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 can I read a directory from CD and place it in excel

I want to archive my CD-roms and find the back in a excel spreadsheet. Does
anyone know how to read directory structure from disk and import them into
axcel?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default How do I can I read a directory from CD and place it in excel

Jaggie,

Assuming your CD drive is D, this will list all files on the active sheet.

Sub FindCDFiles()
With Application.FileSearch
.NewSearch
.LookIn = "D:\"
.SearchSubFolders = True
.FileType = msoFileTypeAllFiles
If .Execute(msoSortOrderDescending) 0 Then
MsgBox "There were " & .FoundFiles.Count & " file(s) found."
For i = 1 To .FoundFiles.Count
Cells(i, 1).Value = .FoundFiles(i)
Cells(i, 2).Value = FileDateTime(.FoundFiles(i))
Cells(i, 3).Value = FileLen(.FoundFiles(i))
Next i
Else
MsgBox "There were no files found."
End If
End With
End Sub

HTH,
Bernie
MS Excel MVP


"Jaggie" wrote in message
...
I want to archive my CD-roms and find the back in a excel spreadsheet. Does
anyone know how to read directory structure from disk and import them into
axcel?



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
Print Directory to Excel Melody Excel Discussion (Misc queries) 13 September 30th 08 05:53 PM
Searching Excel Directory Mickey Excel Discussion (Misc queries) 1 August 14th 08 09:55 PM
Excel and Active Directory javagirl Excel Discussion (Misc queries) 2 March 30th 07 05:04 PM
list directory in EXCEL Bob Phillips Excel Discussion (Misc queries) 1 January 17th 06 04:23 PM
read a column of names and place a number in the next cell Judy Hallinan Excel Discussion (Misc queries) 1 December 7th 05 11:48 PM


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

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

About Us

"It's about Microsoft Excel"