the following macro lists all files from a given directory in Column A of the current excel worksheet.
Just the file names are listed. How is the code to be re-written if I would like to have the whole path listed?
Help is much appreciated. Thank you very much in advance.
'List Files from a given directory in Column A of current excel worksheet
Dim MyFolder As String
Dim MyFile As String
Dim a As Integer
MyFolder = "C:\Test\" ' <-- Change to your folder
MyFile = Dir(MyFolder & "*.*")
a = 0
Do While MyFile <> ""
a = a + 1
Cells(a, 1).Value = MyFile
MyFile = Dir