Peter,
This code gets the FileNames, but doesn't store the names in the worksheet -
should be easy.
NOTE: - Hidden files aren't picked up.
Sub test()
Dim sFileName As String
Dim sMainDir As String
sMainDir = "C:\"
sFileName = Dir(sMainDir & "*.*") ' Initialize "Dir" command!
Do Until sFileName = ""
' Store name here
sFileName = Dir ' Get next file with "Dir"!
Loop
End Sub
regards,
JohnI