HI,
im hoping someone here can help me out to save hours of my workload.
Im trying to export the date in each row to a specific cell in the template, save the file as pdf and do the same to the next row.
let say if i have 50 rows the vba code will save individual 50 template .pdf files
The logic i think is
- For # of rows, for each row
- either open the template or move the data to next sheet
- Copy cells blah blah to new worksheet in specific cells to suit your formatting
- Use VBA to reformat new worksheet to desired specs
- Use VBA to save as PDF with filename the value of patient name and postcode
- Close the new worksheet that is now already saved
- Reiterate for next row, till last row is processed.
dummy worksheet below,
transfer A2(John) to a template say in sheet2 >> A2 = B2, B2=B3, C2=B4, D2=B5, E2=B6 and so on.
and save the new sheet file name as the value of patient name and Postcode.pdf then it will do the same to the next row until the cell is empty.
|
A1 |
B1 |
C1 |
D1 |
E1 |
F1 |
G1 |
<br> |
--- |
--- |
--- |
--- |
--- |
--- |
--- |
<br> |
Patient Name |
Address |
Suburb |
City |
Postcode |
Telephone Number |
Medication record |
<br> |
John |
|
|
|
|
|
AA |
<br> |
Jack |
|
|
|
|
|
AA |
<br> |
|
|
|
|
|
|
BB |
<br> |
|
|
|
|
|
|
XX |
<br> |
Kate |
|
|
|
|
|
CC |
<br> |
|
|
|
|
|
|
BB |
<br> |
Nick |
|
|
|
|
|
BB |
|
|
|
|
|
|
| appreciate the help. <br><br> <br><br>thanks!!! |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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