Generate Multiple PDF's with the available data

VinodKrishnappa

New Member
Joined
Aug 6, 2016
Messages
31
Hi,
I would like to generate individual .pdf files by using a data available in excel. It's like using a employee ID as file name create pay slip in a particular format.

Please let me know if it can be done through macros,

Thanks in advance..

Kind Regards,
VK
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
This is sample code.

Code:
Sub Sample1()
Dim ID As String
Const path = "C:\Users\Desktop\"
ID = InputBox("employee ID ?")
    Sheets("sheet1").ExportAsFixedFormat Type:=xlTypePDF, _
    filename:=path & "_" & ID & "_" & Format(Date, "mmdd") & ".pdf", _
    Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, _
    IgnorePrintAreas:=False, _
    OpenAfterPublish:=False
End Sub
 
Upvote 0
Hi Takae,

I would like to try your reply.
I have excel data
Now where i will appy your code ,
can you please provide me the steps.
I am sorry to ask steps as i am new to macros/advanced excel

Thanks
 
Upvote 0
1. Open your new workbook.
2. Press the keys ALT + F11.
3. Press the keys ALT + I ,and press M(You cn see Standard Module).
4. Copy the code and paste the code to the new module.
5. Press the keys ALT + Q
6. Press ALT + F8 and double click the macro's name to Run it.
I hope this makes some sense.
 
Upvote 0
I have two seperate folders and want to create multiple pdf's
folder one has pdf1, pdf2, pdf3...
folder two has pdf1, pdf2, pdf3...
a new pdf must be created taking pdf1 from both folders and name this as the new pdf1
 
Upvote 0

Forum statistics

Threads
1,222,690
Messages
6,167,666
Members
452,130
Latest member
IRSHAD07

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top