Memuat
Memuat
Automatic Print and PDF Export for meal plan and calories
0 views
One button sets up the Dashboard page and saves it as a date-named PDF next to the workbook. It can also print straight to the printer.

A report ready to send in one click.
The real project file is available. It is not just the picture above: you get the working file with every formula in place. It can be downloaded after payment, and we send the download link by WhatsApp or email.
ZIP: .xlsx workbook + VBA macro module (.zip)
| Cell | Formula | What it does |
|---|---|---|
| J2 | ="Laporan_"&TEXT(TODAY(),"yyyymmdd")&".pdf" | Name of the PDF file to be created. |
| J3 | =SUM(Data!G:G) | Total printed in the report. |
| J4 | =COUNTA(Data!B2:B61) | Number of transactions in the report. |
The macro module is delivered as a separate Modul_Makro.bas file inside the ZIP. Import it through Alt+F11. A short excerpt:
Sub ExportPDF()
Dim ws As Worksheet, p As String
Set ws = ThisWorkbook.Sheets("Dashboard")
p = ThisWorkbook.Path & "\Laporan_" & Format(Date, "yyyymmdd") & ".pdf"
With ws.PageSetup
.Orientation = xlLandscape
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
.CenterHorizontally = True
End With
ws.ExportAsFixedFormat Type:=xlTypePDF, Filename:=p, Quality:=xlQualityStandard, OpenAfterPublish:=True
MsgBox "PDF tersimpan: " & p, vbInformation
End Sub
Sub CetakLangsung()
Sheets("Dashboard").PrintOut Copies:=1
End SubColumns of the Data sheet:
| Meal | Calories per Serving |
|---|---|
| White Rice 100 g | 130 |
| Boiled Chicken Breast 100 g | 165 |
| Boiled Egg 1 Piece | 78 |
| Fried Tempeh 50 g | 110 |
| Steamed Tofu 100 g | 80 |
| Spinach 100 g | 23 |
| Banana 1 Piece | 105 |
| Oatmeal 40 g | 150 |
| Avocado 100 g | 160 |
| Low Fat Milk 200 ml | 90 |
The sample data is synthetic.
Yes. The picture above is only a preview. After payment we send the download link of the real project file (a ZIP containing the .xlsx workbook and the macro module) by WhatsApp or email.
No. The sample data is synthetic and only shows how the formulas behave. Replace it with your own data and the formulas keep working.
Yes, as a separate order. Message us on WhatsApp with a short description of your columns and what you want to see.
Sample data is synthetic. Excel is a trademark of Microsoft Corporation.
Back to Excel portfolio