开发者

Excel VBA: How to Read file names of type PDF and spit them into a column on a sheet

In Excel 2003 is there any way to read pdf file names from a single director开发者_开发问答y and put them inside an Excel spreadsheet?


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜