dgd1212
asked on
Changing part of a macros function (Selecting a pdf file from numerous pdf files in a directory)
Below is macro code currently in use:
Sub DuplicateRename()
strFileCopyFrom = ThisWorkbook.Path & "\" & "Template Checklist.pdf"
For Each c In Range(Range("A2"), Range("A" & Cells.Rows.Count).End(xlUp ))
strFileCopyTo = ThisWorkbook.Path & "\" & "Template Checklist" & "_" & Format(c, "000") & ".pdf"
FileCopy strFileCopyFrom, strFileCopyTo
Next
End Sub
The "Template Checklist.pdf" is fine in there is only one document with that name in the folder.
The folder will soon contain numerous PDF files. Is there an easy way to select the needed file and still fulfill the rest of the macro's function?
Thanks for any suggestions.
Sub DuplicateRename()
strFileCopyFrom = ThisWorkbook.Path & "\" & "Template Checklist.pdf"
For Each c In Range(Range("A2"), Range("A" & Cells.Rows.Count).End(xlUp
strFileCopyTo = ThisWorkbook.Path & "\" & "Template Checklist" & "_" & Format(c, "000") & ".pdf"
FileCopy strFileCopyFrom, strFileCopyTo
Next
End Sub
The "Template Checklist.pdf" is fine in there is only one document with that name in the folder.
The folder will soon contain numerous PDF files. Is there an easy way to select the needed file and still fulfill the rest of the macro's function?
Thanks for any suggestions.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER