How to Print an Excel VBA UserForm and Fix Cut-off Issues
Question details
The user wants to add a print preview and printer selection option for an Excel VBA UserForm before printing to ensure the form does not get cut off.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Developing an Excel VBA UserForm and trying to allow users to review the output layout and choose a printer before finalizing the print.
- Observed behavior
- VBA lacks a native print preview feature for UserForms, and direct printing sometimes results in the printout being partially cut off.
Ensure your VBA UserForm is scaled appropriately to fit within standard paper sizes, as the built-in printing method captures the form exactly as it is sized on your screen.
Use the PrintForm Method in VBA
Since Excel VBA does not support a native print preview for UserForms, you can use the Me.PrintForm command within a button click event to print the form directly to the default printer.
The Me.PrintForm method sends a pixel-by-pixel image of the active UserForm to your system's default printer. It prints the form exactly as it is displayed to the user, though it excludes the form's title bar and borders. Note that it cannot natively trigger a print preview or printer selection dialog.
Open your Excel workbook, press Alt + F11 to open the VBA Editor, and double-click your UserForm in the Project Explorer.
From the Toolbox, insert a CommandButton onto your UserForm. This will act as your 'Print' button.
Double-click the new CommandButton to open its code module. Enter the code 'Me.PrintForm' inside the Private Sub CommandButton1_Click() event and before the End Sub.
Press F5 to run the UserForm. Click the CommandButton you created to send the form directly to your default printer.

Transfer Data to a Worksheet for Print Preview
To utilize Excel's built-in Print Preview and printer selection dialog, transfer the UserForm data to a standard Excel worksheet and print that sheet instead.
Run and Print VBA UserForms Seamlessly with WPS Spreadsheet
WPS Spreadsheet offers robust support for VBA macros and UserForms, allowing you to create, run, and print automated forms just like you do in Microsoft Excel.
- 1. Open Your Macro Workbook: Download and install WPS Office. Open your .xlsm file in WPS Spreadsheet.
- 2. Access the VBA Environment: Navigate to the Developer tab and click Visual Basic to open the VBA editor.
- 3. Configure the Print Button: Double-click your UserForm, insert a Command Button, and add the Me.PrintForm code to its click event.
- 4. Print Your Form: Run the UserForm and click your print button to send the form directly to your default printer.

Frequently Asked Questions
Why is my printed VBA UserForm getting cut off?
The PrintForm method captures the UserForm exactly as it appears on your screen based on your display resolution. If the form is larger than the printable area of your default paper size, it will get cut off. Try reducing the width and height of the UserForm in the VBA editor, or adjust your default printer's paper size settings.
Can I show a printer dialog before using PrintForm?
No, the PrintForm method does not natively support opening a printer selection dialog; it automatically sends the print job to the system's default printer. To change printers, you must change the default printer in Windows before running the form, or use complex Windows API calls within your VBA code.
Does the PrintForm method include the title bar of the UserForm?
No, the PrintForm method only captures and prints the client area (the main body) of the UserForm. It intentionally excludes the title bar, window controls (minimize/close buttons), and the external form borders.




