How to Print Multiple Product Labels Based on Excel Quantity Data
Question details
The user needs to print multiple identical product labels in a mail merge based on a specific quantity value indicated in an Excel column.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Importing Excel product data into a label mail merge where each item requires a different number of printed labels based on a 'Quantity' column.
- Observed behavior
- The mail merge only prints one label per row in the Excel source, completely ignoring the quantity column.
Ensure your Excel dataset has clear column headers, including a dedicated 'Quantity' column, and save a backup copy of your file before running any macros.
Expand Excel Rows Using a VBA Macro
Use a VBA macro to automatically duplicate each product row according to the number specified in the quantity column before performing the mail merge.
Since mail merge creates one label per data row, you must expand your Excel list so that each product appears once for every required label.
A VBA macro can read the quantity column and automatically generate the necessary duplicate rows, saving you from manual copying and pasting.
Open your Excel workbook and press ALT + F11 to launch the Visual Basic for Applications (VBA) editor.
Click 'Insert' in the top menu and select 'Module' to create a blank workspace for your script.
Paste a VBA script designed to loop through your data rows, read the integer in your Quantity column, and copy the row the corresponding number of times.
Ensure your active worksheet contains the product data, then press F5 in the VBA editor to run the script.
Save the newly expanded worksheet. Open your label document, reconnect or refresh the data source to use the expanded list, and complete the merge.
Easily Create and Print Labels with WPS Office
WPS Office provides a highly compatible suite where you can seamlessly prepare your data in Spreadsheets and execute high-volume label Mail Merges in Writer.
- 1. Prepare Data in WPS Spreadsheet: Open your expanded product list in WPS Spreadsheet and verify that the rows match your required label quantities.
- 2. Open WPS Writer: Create a new document in WPS Writer and navigate to the 'Mailings' or 'References' tab.
- 3. Import Data Source: Click 'Mail Merge', select 'Open Data Source', and choose your prepared WPS Spreadsheet file.
- 4. Insert Fields and Print: Insert the required product merge fields into your label template, click 'Merge to Printer', and print your complete set of labels.

Frequently Asked Questions
Why does the mail merge ignore my quantity column?
Mail merge processes data strictly row by row. It natively creates one label per row and does not have a built-in feature to read a quantity column to duplicate records on the fly.
Can I print multiple labels without using a VBA macro?
Yes, you can manually copy and paste the rows in Excel so each product appears the required number of times. However, this is only practical for very small datasets.
How do I add sequential numbers to my duplicate labels?
You can modify the VBA macro to include a counter that populates a new 'Label Number' column during the duplication process. This new column can then be inserted as a merge field in your labels.
What format should my Excel data source be in for a mail merge?
Your data should be organized in a flat, tabular format. Ensure there are clear column headers in the first row (e.g., Product Name, SKU, Quantity), with no blank rows or merged cells interrupting the dataset.




