Hello to everyone.
I would appreciate if someone can help.
Here is what I have and what I need:
This is how the code supposed to work:
Hope I was clear and hope it is feasible
Thanks
I would appreciate if someone can help.
Here is what I have and what I need:
- I have a source sheet "zaposleni" (it is in Serbian, don't pay attention) and a template sheet called "potvrda PPP-PO"
- I have a simple VBA code which takes one information from table source and copy it in my template sheet (based on that information other cells in my template are auto-filled with formulas) and after that it starts printing one by one:
Here it is:
Sub PrintAll()
Dim i As Long, LastRow As Long
LastRow = Worksheets("zaposleni").Range("B1000").End(xlUp).Row
With Worksheets("potvrda PPP-PO")
For i = 2 To LastRow
.Range("C14").Value = Worksheets("zaposleni").Range("B" & i).Value
.Range("Print_Me").PrintOut
Next i
If .FilterMode Then .ShowAllData
End With
End Sub
- This is ok if I want to save one by one manually or merge all in one pdf file, but what I need is the option of auto saving of each file as per specified name.
- As the path to the folder is required it would be also nice to add browser window (to avoid fixing the path in the code) so I could chose the folder in which my pdf files will be stored.
- I would add file names in my source table, sheet "zaposleni" in first empty column which is column "E"
This is how the code supposed to work:
- Start code
- Browser window opens and ask me where I want to save my pdf files
- I'm choosing existing or creating a new folder
- code takes first value from source table (zaposleni B2) and paste in my template sheet
- code prints template to pdf and takes the name from the same row in source table (my table has headers, so it would be E2) and saves the pdf file under that name
- operation repeats with row 3 and so on to the last non-empty row in column B of my source table
Hope I was clear and hope it is feasible
Thanks