I have several thousand .pdf files that I have to rename and wanted to use excel and VBA to do this. I have to current name in column A and the new name in column B. I have been trying to use the code in the following post but it cannot find any files to rename.
http://www.mrexcel.com/board2/viewtopic.php?t=206491&highlight=rename
can anyone help with this code or figure out why it cannot find any files. This is my code:
Sub Find()
Dim i As Integer
With Application.FileSearch
.LookIn = "C:\Test"
.Filename = "Test*.*"
If .Execute > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With
End Sub
Thanks
http://www.mrexcel.com/board2/viewtopic.php?t=206491&highlight=rename
can anyone help with this code or figure out why it cannot find any files. This is my code:
Sub Find()
Dim i As Integer
With Application.FileSearch
.LookIn = "C:\Test"
.Filename = "Test*.*"
If .Execute > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With
End Sub
Thanks