0

In Excel 2003 is there any way to read pdf file names from a single directory and put them inside an Excel spreadsheet?

EKet
  • 7,272
  • 15
  • 52
  • 72

2 Answers2

1
Dim c as Range, tmp  
Dim FolderPath as string

FolderPath = "C:\MyFolder\" 
Set c = ActiveSheet.Range("A1")

tmp = Dir(FolderPath & "*.pdf")
Do While tmp<>""
  c.value = tmp
  set c = c.offset(1,0)  
  tmp=Dir()
Loop

Tim

Tim Williams
  • 154,628
  • 8
  • 97
  • 125
  • 1
    +1 I guess some of us just get it the first time. Thanks a bunch I did not know it was that easy. – EKet Mar 31 '11 at 06:37
0

To list files from a folder take a look at FileSystemObject.

Provide os more info about what you need, we'll help you better.

Rgds

Community
  • 1
  • 1
Tiago Cardoso
  • 2,057
  • 1
  • 14
  • 33