View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Kevin B Kevin B is offline
external usenet poster
 
Posts: 1,316
Default Export folder/file listings from Windows Explorer to Excel/Word.

In the event that Microsoft does not get around to your request, here's a
small macro that will do that for you. Just change the path in the DIR
command to the directory you want the files listed from:

Sub PostFileNames()

Dim strDir As String
Dim strFile As String
Dim lngRow As Long

ActiveWorkbook.Worksheets("Sheet1").Activate
Range("A1").Select
strDir = "C:\*.*"
strFile = Dir(strDir)

Do While strFile < ""
ActiveCell.Offset(lngRow).Value = strFile
lngRow = lngRow + 1
strFile = Dir
Loop

End Sub
--
Kevin Backmann


"CandiceMyers" wrote:

I would like to be able to take a file/folder listing from Windows Explorer
and copy it into Excel or Word.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...el.programming