One dots of our productivity theory is Speed-Up, what we mean is to find a solution for repetitive task.
Think if you have an Excel invoicing template and you need to save each invoice in PDF format with a specific name in a particular folder. What will you do to don't lose time saving a new invoice??
Today we will show you how to save PDF files with one click on Microsoft Excel using Macro:
1- Adding the developer tab:
Go to Excel options - Customize Ribbon and add the Developer Tab:
2- Adding "save to pdf" Module:
2- Adding "save to pdf" Module:
Go to DEVELOPER TAB - Click on Visual Basic Editor or Press Alt+F11:
On the left, in the VBA Project, Insert an new module:
3- Some code:
3- Some code:
In this example, we will save invoices on a a folder named "Invoices" on c:/.
The files will be named "Invoice number + Customer name + Invoice date"
Range("C8") + Range("L8") + Range("L9")
Range("L8"): Customer Name
Range("C8"): Invoice Number
Range("L9"):Invoice Date
Now past the following code (Feel free to change the PDF name format by changing the Text in bold):
Sub save_PDF()
Dim file_name As String
file_name = Range("L8").Value & " " & Range("C8").Value & Format(Now(), "dd-mm-yyyy")
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\Invoices\" & file_name _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End Sub
4- Adding the button:
Go to Developer Tab, Insert, Button
Excel will ask you if you like to assign a Macro to it - Select "Save_PDF" and click OK.
5- Each time you will click on this button, you will save the file as PDF on the specific folder.
Speed-UP of our theory is to find every time a solution for repetitive task, also keep in mind REPETITIVE TASK = MONOTONE so NO CREATIVITY