VBA & Macro Problems

How to Automate Excel Tournament Score Updates with VBA

Ayan MasoodAyan Masood Oct 8, 2026 871 views

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.

How to Automate Excel Tournament Score Updates with VBA
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the VBA Editor

Press ALT + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor.

2
Insert a New Module

Click on 'Insert' in the top menu bar and select 'Module' to create a blank script window for your code.

3
Write the Looping 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.

4
Append to the Next Available Row

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.

5
Run the Macro

Close the VBA editor and press ALT + F8, select your new macro, and click 'Run' to update the individual worksheets.

Use a VBA Macro to Loop and Update Member Sheets
Sheet Naming Consistency: Ensure that your worksheet names perfectly match the player IDs or names used in the master table to prevent 'Subscript out of range' errors.
Advanced Automation with WPS Office

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. 1. Open your Macro workbook: Launch WPS Spreadsheet and seamlessly open your golf-club .xlsm file without formatting loss.
  2. 2. Access the Developer Tools: Navigate to the 'Developer' tab on the ribbon to access the built-in VBA editor and macro manager.
  3. 3. Run the automation code: Execute your macro directly within WPS to instantly update all individual member worksheets with the latest tournament scores.
Fully compatible with Microsoft Excel (.xlsx and .xlsm) formats.Built-in support for VBA macros and developer tools to automate repetitive tasks.Lightweight architecture ensures smooth performance even with multiple sheets.Free to download and use with a highly intuitive, tabbed interface.
microsoft office alternative - wps office

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.