Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Creating new files and file names from data within Excel

Posted on 2013-10-27
4
Medium Priority
?
245 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 40

Expert Comment

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

Accepted Solution

by:
Rgonzo1971 earned 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

604 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