用DIR这个函数来列出某个文件夹下的内容,以excel里的为例 Dim i As Integer i = 1 Sheet1.Range("A" & i) = Dir("C:\") Do While True i = i + 1 Sheet1.Range("A" & i) = Dir If Sheet1.Range("A" & i) = "" Then Exit Do Loop