Hi everyone,
I am looking to print specific sheets of an excel workbook based on a data table.
In the "Control Sheet" of my sample file, I have a list of Student IDs. The first Student ID is copied in E2, and then the table shows which pages the student needs (YES/blank). The macro then prints only the sheets that have a value in column B to create a booklet tailored to each student (rather than printing all the sheets).
For the most part my code is working, I just can't get the macro to loop through the list of Student IDs. As of now, it only copies the first Student ID on the list into cell E2 and prints. Since I have so many students, it would be a great help to print the sheets for all my students automatically.
Eventually I would also like to save the booklets as PDF's and send them to each student.
I am quite new to VBA and would really appreciate any help you are able to provide. Thanks so much!
Warm regards,
Jacqueline
Hi Jacqueline
See if this helps.
I have added a macro that will print the required sheets for each student to individual PDF.
It will read the data from the Data Dump sheet and will ignore any sheets not found e.g. PAGE 7, PAGE 8 etc.
IMPORTANT : Please change the output folder (in the macro) to where you want the PDF files to be saved.
More instructions are included in the attached.
Cheers
Sunny
Wow thanks so much Sunny for your work, this works great!!!
Is it possible to incorporate this macro into the "Control Sheet" tab? Sorry I should've clarified earlier, I would love to be able to choose a list of student ID's and have it print those booklets (rather than always having to print everything from the data table).
My only other question is if I can manipulate that Print to PDF macro and have it send to the students emails? So for example, if I have a table with the student ID in column A, email in column B, and the filename path in column C-Z all in the "PrintoPDF"tab. I found a macro code that I have added to the workbook but can't seem to get working. I think its the filename that's the problem? I have used the excel function =CELL("filename") to retrieve it but I must be missing something.
Thanks!
Warmest regards,
Jacqueline
Hi Jacqueline
Attached is the revised print to PDF file. It uses Data Validation to select the ID and then print.
The second file is a utility to send e-mail modified from my own files (not 100% tested due to lack of time, but working so far).
The e-mail is currently set to Save. Change if you need it.
Hope this helps.
Sunny