Forum Discussion
jhighland2
Feb 26, 2025Copper Contributor
Using a master list on one sheet for trackers on other sheets.
I'm sure I can accomplish the following using VBA, but I'm looking for a solution that will work in both the desktop and the web app. I'm not familiar yet with script code or using Power Automate, so if it is possible using these tools, I'd appreciate guidance towards tutorials that will get me started.
Situation:
Sheet 1 of a workbook contains a list of clients. Over time, columns have been added to track various items, tasks and processes pertaining to the clients; it has gotten to be a jumbled, cumbersome mess. I want to start separating out these various columns to separate worksheets so that each worksheet is a separate tracker for specific related data.
For this to work, I need certain data for each client (e.g. Client ID #, Last name, First name) to be copied from the master list to a table on the pertinent tracking worksheet when a client's status is changed on the master list. For example, if I change Bob Smith's status on the master list from "Application" to "Pending", Bob Smith's data is copied from the master list to the first few columns of a new row on the "Pending" table of the Pending worksheet. The "Pending" table will have additional columns be where the pending process is tracked.
Thank you for any advice offered!
- m_tarlerBronze Contributor
So I would say you actually have a good set-up with all the data on your master sheet. On the 'tracking' sheet you can use either Pivot Table or Dynamic Array Functions like FILTER, PIVOTBY, GROUPBY to produce a 'slice' of the master data that is clearer. Let's say the table on the Client page is calle Client_Data then on the Pending tab a simple formula could be:
=FILTER(Client_Data, Client_Date[Status]="Pending", "none")
which will present all the pending status from the main table. Of course you can customize that to only show particular columns or filter by other criteria too
- jhighland2Copper Contributor
I'll play around with those options, but my concern is that they might be a bit too dynamic; in other words, if someone mistakenly changed the condition from "Pending" to "Complete" on the master list, the client would be gone on the Pending tab (and what would happen with the related pending status data that was entered in relation to that client?).
- m_tarlerBronze Contributor
so yes if some changes the status from pending to complete or vice verse it should move them, isn't that the point?
as for "the client would be gone on the Pending tab (and what would happen with the related pending status data that was entered in relation to that client?)." this makes me concerned. You should not enter data on a filtered or lookup list. My impression was that you have all the data on the master tab. Then the other tabs are just 'reports' or view portals.
If you need additional data you should set up multiple data entry tables but only use a unique identified between them. For example you have personnel with a userID, name, address, .... and then another table with work hours with userID, date, hours, location, .... Then you can query a user info with there personal info from the pesonnel table and the worked hours from the work table.
- NikolinoDEGold Contributor
You can maybe achieve this in Excel for the Web using Office Scripts, which work in both the web and desktop versions of Excel.
function main(workbook: ExcelScript.Workbook) { // Define sheet names let masterSheet = workbook.getWorksheet("Master List"); let pendingSheet = workbook.getWorksheet("Pending"); // Define column indices (adjust as necessary) let statusCol = 4; // Assuming "Status" is in column D (index 4) let clientIdCol = 1; // Column A (index 1) let lastNameCol = 2; // Column B (index 2) let firstNameCol = 3; // Column C (index 3) // Get used range of the Master List let masterRange = masterSheet.getUsedRange(); let masterValues = masterRange.getValues(); // Get table on the Pending sheet let pendingTable = pendingSheet.getTables()[0]; // Assumes there's a table on "Pending" // Loop through Master List for (let i = 1; i < masterValues.length; i++) { // Skip headers let row = masterValues[i]; let status = row[statusCol - 1]; // Adjust for zero-based index if (status === "Pending") { let clientId = row[clientIdCol - 1]; let lastName = row[lastNameCol - 1]; let firstName = row[firstNameCol - 1]; // Check if Client already exists in the Pending table let existingRows = pendingTable.getRange().getValues(); let exists = existingRows.some(r => r[0] === clientId); // Check if Client ID is already added if (!exists) { // Add new row to the Pending table pendingTable.addRow(-1, [clientId, lastName, firstName]); } } } }
Backup your file, Script is untested.
To make the script run automatically whenever the Master List is updated:
Open Power Automate.
Create a new flow with the "When a row is modified in Excel" trigger.
Set the trigger to monitor the Master List.
Add an action: Run Office Script and select your script.
My answers are voluntary and without guarantee!
Hope this will help you.
- jhighland2Copper Contributor
Thank you! I've been putting together VBA code to test the process on the desktop, so this gives me a great starting point for comparison and, ultimately, conversion!