How to Automate Excel Tournament Score Updates with VBA
Question details
The user needs to automate the process of appending members' new tournament dates and scores to individual worksheets based on a master results table.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Managing a golf-club workbook containing member records, tournament results, and individual member worksheets that require regular score updates.
- Observed behavior
- The goal is to loop through a tournament results table, extract each player's ID, date, and score, and automatically write this data to the next available empty row on the corresponding player's worksheet.
Ensure your workbook is saved as an Excel Macro-Enabled Workbook (.xlsm) and that you have enabled macros in your Trust Center settings so the VBA code can execute properly.
Use a VBA Macro to Loop and Update Member Sheets
Create a VBA script to automatically loop through the tournament results table and append the new score and date to each corresponding member's worksheet.
This method is ideal if your workbook is already structured with individual worksheets for each member. The macro iterates through the master list, finds the matching sheet, and logs the score without overwriting existing data.
Press ALT + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor.
Click on 'Insert' in the top menu bar and select 'Module' to create a blank script window for your code.
Enter a VBA script utilizing a 'For Each' loop to iterate through the player IDs in your results table. Store the associated date and score variables during each loop.
In your loop, activate the specific player's worksheet and use the code 'Cells(Rows.Count, 1).End(xlUp).Row + 1' to identify the next empty row, then assign the date and score to those cells.
Close the VBA editor and press ALT + F8, select your new macro, and click 'Run' to update the individual worksheets.

Use Power Query for Larger Datasets
If you have a massive dataset or prefer a no-code solution, Power Query is highly efficient for transforming and combining tournament data automatically.
Automate Data Workflows Seamlessly in WPS Spreadsheet
WPS Spreadsheet provides robust, native support for VBA macros and advanced data processing, allowing you to automate tournament score updates and manage complex workbooks effortlessly.
- 1. Open your Macro workbook: Launch WPS Spreadsheet and seamlessly open your golf-club .xlsm file without formatting loss.
- 2. Access the Developer Tools: Navigate to the 'Developer' tab on the ribbon to access the built-in VBA editor and macro manager.
- 3. Run the automation code: Execute your macro directly within WPS to instantly update all individual member worksheets with the latest tournament scores.

Frequently Asked Questions
Why is my VBA code returning a 'Subscript out of range' error?
This usually occurs if the sheet name the code is trying to access does not exactly match the player ID in your results table. Check for trailing spaces or spelling differences between the table entries and the worksheet tabs.
Can I run this macro without saving my file as a macro-enabled workbook?
No, to save and execute VBA code, you must save your file as an Excel Macro-Enabled Workbook (.xlsm). Saving as a standard .xlsx file will permanently delete your VBA scripts upon closing.
Is Power Query better than VBA for updating scores?
Power Query is generally better and more stable for combining, cleaning, and filtering large datasets dynamically. However, if your strict requirement is to push new lines of data into pre-existing, separate worksheets, VBA remains the standard approach.




