Here is what i have:
Sub findfiles()
Application.ScreenUpdating = False
Dim FN As String ' For File Name
Dim ThisRow As Long
Dim MyFileLocation As String
MyFileLocation = "C:\temp\New Folder"
FN = Dir(MyFileLocation)
Do Until FN = "B10520-15-A-SL-F1-9901-.dwg"
ThisRow = ThisRow + 1
Cells(ThisRow, 1) = FN
Cells(ThisRow, 2) = MyFileLocation + FN
FN = Dir("C:\Temp\New Folder")
Loop
Application.ScreenUpdating = True
End Sub
When i do that, it sorta gets the job done. except all it says in the cells is: "C:\Temp\New Folder", and i want it to say the file name. not the path. i tried it again and got the results to read A file...but it was the same file all the way down to 7000 cells.
Also, although this isnt a big deal, but it might affect your answer, it copies all the way down to the 66000th cell or what ever.
Finally, after it does its thing and puts all that stuff in the cells, i get a small error in the line "Cells(ThisRow, 1) = FN" that says "run time error 1004 app defined or obj defined error"
I heard that this is wrong because i have the directory too many times or something.
Also, What do i put in where it says "Do Until FN = "B10520-15-A-SL-F1-9901-.dwg""
Any guidance would be much appreciated.
Thanks.
paul
Bookmarks