本文为《别怕,Excel VBA其实特别简单(第3版)》随书问题参考答案
要解决本例的问题,可以用下面的过程:
Sub 获取文件名称()
Dim Irow As Integer, FileName As String
Irow = 1
FileName = Dir("D:\我的文件\*.xlsx")
Do While FileName ""
Cells(Irow, "A").Value = FileName
Irow = Irow + 1
FileName = Dir
Loop
End Sub
本文为《别怕,Excel VBA其实特别简单(第3版)》随书问题参考答案
要解决本例的问题,可以用下面的过程:
Sub 获取文件名称()
Dim Irow As Integer, FileName As String
Irow = 1
FileName = Dir("D:\我的文件\*.xlsx")
Do While FileName ""
Cells(Irow, "A").Value = FileName
Irow = Irow + 1
FileName = Dir
Loop
End Sub