Automatically Print Personalized Forms for Multiple Names in Excel VBA
Question details
Create a reusable Excel form that automatically prints a separate personalized copy for every name in a list.

- Product
- Microsoft Excel VBA
- Device & OS
- not provided
- Scenario
- The workbook contains a form sheet with a name field and a separate worksheet that stores names in a column.
- Observed behavior
- The goal is to place each listed name into the form's designated cell and print the form once before continuing to the next name.
Save the workbook as an Excel Macro-Enabled Workbook (*.xlsm) and confirm that the form prints correctly for one sample name. Replace the worksheet names and cell references in the macro if your workbook uses different locations.
Use a VBA macro to fill and print each personalized Excel form
Use this method when names are listed on one worksheet and the same form must be printed once for every name.
This example uses a worksheet named Form, places the current name in cell B1, and reads names from column A of a worksheet named List starting at A2. The macro prints the form after each name is inserted.
On the Form worksheet, choose the cell that displays the recipient name, such as B1. On the List worksheet, enter each name in column A, beginning in cell A2.
Select File > Save As, choose Excel Macro-Enabled Workbook (*.xlsm), and save the file.
Press Alt+F11 in Excel, then select Insert > Module to create a standard VBA module.
Paste this code into the module: Sub PrintForms() Dim formSheet As Worksheet Dim listSheet As Worksheet Dim nameRow As Long Dim lastRow As Long Application.ScreenUpdating = False Set formSheet = Worksheets("Form") Set listSheet = Worksheets("List") lastRow = listSheet.Cells(listSheet.Rows.Count, "A").End(xlUp).Row For nameRow = 2 To lastRow formSheet.Range("B1").Value = listSheet.Cells(nameRow, "A").Value formSheet.PrintOut Next nameRow Application.ScreenUpdating = True End Sub
Return to Excel, press Alt+F8, select PrintForms, and click Run. Excel inserts each name into Form!B1 and sends one form to the selected printer.

Preview each form before printing from VBA
Use this variation when you want to review each personalized form instead of sending all copies directly to the printer.
Create and Print Personalized Forms in WPS Spreadsheets
WPS Spreadsheets can help you build a reusable form, maintain a recipient list, and automate personalized printing with VBA-compatible macro tools on supported desktop editions. Its familiar spreadsheet layout makes it easy to migrate an existing Excel form workflow.
- 1. Open the workbook in WPS Spreadsheets: Launch WPS Office, select Spreadsheets, and open the XLSM workbook containing the Form and List worksheets.
- 2. Confirm the form name cell: Select the recipient cell on the Form worksheet, such as B1, and confirm that it appears correctly in File > Print preview.
- 3. Open the macro editor: Use the Developer or Macro tools available in your WPS desktop edition to open the VBA-compatible editor and add the PrintForms procedure.
- 4. Run the printing procedure: Open the Macro dialog, select PrintForms, and run it to fill the form with each name from the List worksheet and print each copy.

Frequently Asked Questions
Where should I put the names that the macro will print?
Place the names on the List worksheet in column A, starting at A2. The provided macro finds the last nonblank cell in that column and processes each row.
How do I change the cell where the name appears on the form?
Change formSheet.Range("B1") in the VBA code to the target form cell. For example, use formSheet.Range("D5") if the name field is in D5.
Can I print more than a name on each form?
Yes. Add additional assignments inside the loop, such as formSheet.Range("B2").Value = listSheet.Cells(nameRow, "B").Value, to insert values from other list columns.
Why does Excel show a macro security warning when I open the workbook?
Macros are disabled by default for security. Open the XLSM file from a trusted location and select Enable Content only after confirming that the VBA code is safe.
How can I preview the forms instead of printing them immediately?
Replace formSheet.PrintOut with formSheet.PrintPreview in the macro. Excel will display each personalized form in print preview before it is printed.




