is this what you want?
Sub GetFileNames2()
Dim xRow As Long, xDirect$, xFname$, InitialFoldr$
xDirect$ = "c:\TestArea\" 'amend to match your chosen folder & end with "\"
xFname$ = Dir(xDirect$, 7)
Do While xFname$ <> ""
ActiveCell.Offset(xRow) = xFname$
xRow = xRow + 1
xFname$ = Dir
Loop
End Sub
Welcome to the forum
Please use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the [#] button at the top of the post window (if you are editing an existing post, press Go Advanced to see the [#] button).
[ code ]
your code here ...
and here ...
and here
[ /code ]
Please amend your first post
thanks
Bookmarks