Link to home
Start Free TrialLog in
Avatar of dgd1212
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.
ASKER CERTIFIED SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dgd1212
dgd1212

ASKER

Thank you!