Wauvel

Excel like a finance pro.

The functions, VBA, and shortcuts a finance operator actually uses — curated, with CFO examples. Prefer them pre-built? Grab a ready-made model.

← All VBA snippets

Export each sheet as its own PDF

Saves every worksheet as a separate PDF next to the workbook — board packs in one click.

Difficulty

Good
Workbook

1What it does

Walks every worksheet and saves each one as its own PDF in the same folder as the workbook, named after the sheet. Before exporting it stamps each page with a branded header (the sheet name) and footer (your name + page numbers) — change the BRAND and colour constants at the top to make them yours. Turns a monthly reporting pack into a one-click export.

2The code

Sub ExportSheetsToPDF()
    ' --- Your brand · stamped into every PDF's header & footer ---
    Const BRAND As String = "Wauvel"
    Const SITE As String = "wauvel.com"
    Const INK As String = "16161D"     ' header colour (hex RRGGBB)
    Const MUTED As String = "5C5C66"   ' footer colour

    Dim ws As Worksheet, folder As String
    folder = ThisWorkbook.Path & "\"
    If folder = "\" Then
        MsgBox "Save the workbook first so I know where to put the PDFs.", _
            vbExclamation, BRAND
        Exit Sub
    End If

    For Each ws In ThisWorkbook.Worksheets
        With ws.PageSetup
            .CenterHeader = "&""Calibri,Bold""&14&K" & INK & ws.Name
            .LeftFooter = "&""Calibri""&9&K" & MUTED & BRAND & " - " & SITE
            .RightFooter = "&""Calibri""&9&K" & MUTED & "Page &P of &N"
            .CenterHorizontally = True
        End With
        ws.ExportAsFixedFormat Type:=xlTypePDF, _
            Filename:=folder & ws.Name & ".pdf", Quality:=xlQualityStandard
    Next ws

    MsgBox "Exported " & ThisWorkbook.Worksheets.Count & _
        " branded PDFs to:" & vbCrLf & folder, vbInformation, BRAND
End Sub

Paste into the Visual Basic Editor (Alt + F11 → Insert → Module), then run and save as macro-enabled (.xlsm) — or download the workbook: a branded Excel file with this code on a sheet, sample data to run it on, and a step-by-step setup guide.

New to macros? Set up in 5 minutes
  1. 1

    Don't see the Developer tab in the ribbon?

    You don't strictly need it — Alt + F11 opens the editor directly — but it makes running macros easier.
    • Windows: File → Options → Customize Ribbon → tick Developer in the right-hand list → OK.
    • Mac:Excel → Preferences → Ribbon & Toolbar → tick Developer → Save.
  2. 2

    Paste in the code

    Press Alt + F11 to open the Visual Basic editor, then Insert → Moduleand paste the snippet's code into the blank window. Close it with Alt + Q.
  3. 3

    Run it

    Press Alt + F8, pick the macro's name, and click Run — that's it. (Pasted a custom function instead? Just type it into a cell like any built-in: =GrossMargin(B2, B3).)
  4. 4

    Keep the macro — save as .xlsm

    File → Save As → Excel Macro-Enabled Workbook (.xlsm). A plain .xlsx silently drops the code when you save.
  5. 5

    Macros blocked?

    Click Enable Content on the yellow bar. If you downloaded the file, you may first need to right-click it → Properties → tick Unblock → OK, then reopen.

Heads up: macros can't be undone with Ctrl + Z — save a copy before running one that changes your workbook.

3When you use it

  • Produce a board or lender pack — one PDF per statement.
  • Archive a point-in-time copy of each tab.
  • Send individual sheets without sharing the whole model.

4See it in action

A simulation — press Run to perform what the macro does to a sample workbook.

Workbook tabs

P&LBalance SheetCash FlowAssumptions

5Pitfalls

PDFs paginate oddly.

Fix: Set each sheet's print area and page setup first (Page Layout → Print Area).

An existing PDF gets overwritten silently.

Fix: Export into a dated subfolder, or check before running.

6No-code alternatives

  • File → Export → PDF Built-in export for a single sheet or the whole workbook.
  • Print → Save as PDF Quick one-off without code.

Rather not write macros? Wauvel's free tools generate branded, formula-driven Excel for you — no VBA required.

Learn the moves here — or let Wauvel run them on your numbers.

Get my free report →