Solved

Creating new files and file names from data within Excel

Posted on 2013-10-27
4
209 Views
Last Modified: 2013-10-27
Not sure if this is even possible...

In a directory I have a template checklist PDF file. In same directory I have a spreadsheet that contains a list of product numbers.

Is it possible to take that template checklist PDF file and add a product number to its file name and then save

Then repeat the process till all the product numbers are attached to the template.

In effect creating new files in addition to the template file.  The directory looking like:
Template Checklist.PDF
Template Checklist_001.PDF
Template Checklist_002.PDF
Template Checklist_003.PDF
etc..
0
Comment
Question by:dgd1212
  • 2
4 Comments
 
LVL 39

Expert Comment

by:als315
ID: 39603848
Do you like to make copies of your pdf template with new names?
0
 
LVL 49

Accepted Solution

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

pls try

Sub Macro()

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

Open in new window

Regards
TestPdf.xlsm
0
 

Author Comment

by:dgd1212
ID: 39604220
Thank you!. Works perfect!!
0
 

Author Closing Comment

by:dgd1212
ID: 39604222
Thank you!! perfect!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

914 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now