How to Automatically Create a Purchase Order from Excel Data
Question details
The user wants to learn how to automatically generate formatted purchase orders using raw data stored in an Excel spreadsheet.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Streamlining the creation of purchase orders from inventory or procurement data sheets instead of manually typing the details each time.
- Observed behavior
- Requires a setup that maps items, quantities, and prices from a data sheet into a dedicated purchase order template, optionally using VBA for automation.
Ensure your raw data is organized in clear columns (e.g., Item Name, Quantity, Price) on a single worksheet, and prepare a blank worksheet to serve as your purchase order template.
Create a Purchase Order Using Cross-Sheet Formulas
This straightforward method uses standard Excel formulas to link raw data directly to your purchase order template without requiring programming skills.
By leveraging simple cell referencing, you can create a dynamic template that updates automatically whenever the raw data is modified.
Set up your raw data on the first worksheet (e.g., named 'Data') with clear column headers such as Item, Quantity, Unit Price, and Supplier Details.
Create a new worksheet in the same workbook. Design the layout of your purchase order, leaving blank cells where the specific data points should be displayed.
Click on a blank cell in your template (e.g., the Item Name field). Type '=' and then click the corresponding cell on the 'Data' worksheet (e.g., =Data!A2). Press Enter to link the cells.
Use standard formulas like =B10*C10 to calculate the total price for items, and the =SUM() function at the bottom to calculate the final purchase order amount.
Change a value in the 'Data' worksheet and verify that the linked cell in the purchase order template updates automatically.

Automate Purchase Order Generation with VBA Macros
Use a VBA macro to automatically pull data, populate the template, and generate purchase orders with a single button click.
Create Automated Purchase Orders in WPS Spreadsheet
WPS Spreadsheet provides powerful cross-sheet referencing and VBA-compatible macro capabilities, making it incredibly simple to build automated purchase order systems.
- 1. Organize data in WPS Spreadsheet: Launch WPS Spreadsheet and input your inventory or supplier data neatly into the first worksheet.
- 2. Set up the template: Create a second sheet for your purchase order layout, or download a free business template directly from the WPS Template library.
- 3. Link data using references: Select the target cells in your template, type '=', and click the corresponding source data cells on the first sheet to establish a dynamic link.
- 4. Save with macros enabled: If you implement macros for batch processing, go to Menu > Save As and select the '.xlsm' format to preserve your automation scripts.

Frequently Asked Questions
Can I generate multiple purchase orders at once from my Excel data?
Yes. While formulas handle one template at a time, you can use VBA macros to write a script that loops through each row of your data sheet, populates the template, and automatically prints or saves each purchase order as a separate PDF.
Why do my cross-sheet cell references show a #REF! error?
A #REF! error usually occurs if the original data cell was deleted or if the referenced worksheet name was changed. Ensure your formula uses the exact sheet name (e.g., =Sheet1!A1) and that the source data has not been removed.
Do I have to use VBA to make a purchase order template work?
No. VBA is strictly optional and only needed for advanced tasks like batch generation or adding one-click buttons. For a standard, auto-updating purchase order, standard Excel cell references and functions (like VLOOKUP or SUM) are completely sufficient.
How do I save my workbook if I decide to use VBA automation?
If your file contains VBA macros, you must save it as an Excel Macro-Enabled Workbook (.xlsm). If you save it as a standard workbook (.xlsx), all your VBA code and automation buttons will be permanently removed.




