Hello,
The following is a macro that will go into a particular folder and pull the names of each excel file. (first characters of each file in the folder) It will list them in column "A" of a spreadsheet, It will space them out after every 16 rows.
The question is, how do I get the macro to paste the information in each row? It only does it after every 16 rows. Any help would be greatly appreciated. Thanks!
The following is a macro that will go into a particular folder and pull the names of each excel file. (first characters of each file in the folder) It will list them in column "A" of a spreadsheet, It will space them out after every 16 rows.
The question is, how do I get the macro to paste the information in each row? It only does it after every 16 rows. Any help would be greatly appreciated. Thanks!
Code:
Sub ListFiles()
Dim MyPathName As String
Dim MyFileName As String
Dim NumChars As Long
Dim X As Long
NumChars = 8
MyPathName = "C:\Users\copleyr\Desktop\All/"
MyFileName = Dir(MyPathName)
Do While MyFileName <> ""
X = X + 16
Sheet1.Cells(X, 1) = Left(MyFileName, NumChars)
MyFileName = Dir
Loop
End Sub