How to Automate Repeated Data Entry Across Districts in Excel
Question details
The user needs to populate rate data for 16 schools across more than 1,000 districts without manually copying and pasting the information.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Automating the creation of approximately 16,000 unique district-school combinations to streamline bulk data entry.
- Observed behavior
- The user currently copies and pastes 16 school rates manually for each of the 1,000+ districts, which is inefficient and time-consuming.
Verify that your District IDs and School IDs are strictly unique before generating combinations, as duplicate identifiers can cause calculation errors when scaling up to thousands of records.
Use Power Query to Generate Combinations
Power Query is the most reliable and maintenance-friendly method to cross-join lists (e.g., generating 16,000 combinations from 1,000 districts and 16 schools).
By utilizing Power Query, you avoid writing complex code. It automatically creates a Cartesian product (cross-join) of your two lists and is easily refreshable if you add new districts or schools later.
Select your list of District IDs and press Ctrl+T to format it as a Table. Repeat this process for your list of School IDs on a separate sheet.
Click anywhere inside your District table, go to the 'Data' tab, and select 'From Table/Range'. In the Power Query Editor, go to 'Close & Load To...' and choose 'Only Create Connection'. Do the same for the School table.
Open the District query again. Go to 'Add Column' > 'Custom Column'. In the formula box, simply type the exact name of your School query (e.g., = Schools) and click OK.
Click the double-arrow icon on the header of the newly created custom column to expand it. Uncheck 'Use original column name as prefix' and click OK. Finally, click 'Close & Load' to output the 16,000 generated combinations into a new Excel worksheet.

Automate with a VBA Macro
Use VBA scripting to programmatically loop through each district and paste the school identifiers automatically.
Automate Large Data Combinations with WPS Spreadsheet
WPS Spreadsheet easily handles large-scale data entry tasks with advanced structured tables, robust array formulas, and VBA macro support, allowing you to generate thousands of records efficiently.
- 1. Organize Your Data: Open your workbook in WPS Spreadsheet and organize your District IDs and School IDs into separate, clearly labeled columns.
- 2. Format as Tables: Highlight your data and use the 'Format as Table' feature from the Home tab to structure your identifiers for easier referencing.
- 3. Run Automation: Access the Developer tab to record or write a VBA macro that loops through your tables, instantly generating the 16,000 required combinations.
- 4. Save and Export: Save your completed dataset in .xlsx format to ensure full compatibility with colleagues using other spreadsheet software.

Frequently Asked Questions
Why is Power Query preferred over VBA for automating repeated data entries?
Power Query is highly visual, easier to maintain, and does not require coding knowledge. It also recalculates instantly when you refresh the data, making it much simpler to handle future additions to your district or school lists.
How do I ensure my School IDs are unique across different districts?
You can use the 'Remove Duplicates' feature found under the Data tab on your source lists before running any automation. Additionally, applying Conditional Formatting to highlight duplicate values can help you manually spot errors.
Will generating 16,000 combinations slow down my spreadsheet?
No. Modern spreadsheet programs can comfortably handle over a million rows. A dataset of 16,000 records is relatively small and will not cause performance or lagging issues once generated.




