Solved

Edit a Macro to input text

Posted on 2013-12-01
2
206 Views
Last Modified: 2013-12-01
I currently have this macro:
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

This line needs to be changed:
strFileCopyFrom = ThisWorkbook.Path & "\" & "Template Checklist.pdf"

I need to be able to input various form names from Sheet 1 C3 in place of the same name of "Template Checklist.pdf"

Thanks
0
Comment
Question by:dgd1212
2 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39688158
Hi,

pls try

strFileCopyFrom = ThisWorkbook.Path & "\" & Sheets("Sheet1").Range("C3").Value

Open in new window

Regards
0
 

Author Closing Comment

by:dgd1212
ID: 39688188
Thank you!
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question