Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8912757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:17:12+00:00 2026-06-15T04:17:12+00:00

There is a Master worksheet, which needs to be populated by more than 75

  • 0

There is a Master worksheet, which needs to be populated by more than 75 child sheets with different values.

EDIT:
The situation has changed slightly.

  'AGENTS'
  Agent Name  Sheet ID
1 Tom         Link to Tom's sheet
2 John        Link to John's sheet
3 Mary        Link to Mary's sheet
etc.

links to:

'MASTER SHEET'
        A                    C                       D
    Agent Name  Value 1 from Agent's Sheet Value 2 from Agent's Sheet
1                           D46                     D53
2                           D46                     D53
3                           D46                     D53

Also this is based on 1 cell which refers to the week no.
So if the cell F11 on the Master is ’39’ it would pull the data from the agent sheets from that particular week.

I have made a feeble attempt to alter the code to this:

var agentNames = SpreadsheetApp.getActive().getSheetByName('AGENTS').getRange('A2:A35').getValues();//these are the agent names
var agentID = SpreadsheetApp.getActive().getSheetByName('AGENTS').getRange('B2:B35').getValues();//here are their sheets
var agentSheets = SpreadsheetApp.openById(agentSheets[i][0]);
var array1 = [];
var array2 = [];
var array3 = [];
var masterSheet = SpreadsheetApp.getActive().getSheetByName('MASTER');
var sheetName =   SpreadsheetApp.openById('B2') + 'F2' + (masterSheet.getRange('F11').getValue());
var temp;

for (var i = 0; i < numAgents; i++) {
temp = SpreadsheetApp.openById(agentSheets[i][1]).getSheetByName(sheetName).getRange('D46:D53').getValues();
array1.push([agents[i][0]]);
array2.push([temp[0][0]]);
array3.push([temp[7][0]]);
    }

masterSheet.getRange(2, 1, numAgents, 1).setValues(array1);//Agent names
masterSheet.getRange(2, 3, numAgents, 2).setValues(array2);
masterSheet.getRange(2, 4, numAgents, 2).setValues(array3);

 }

Would JavaScript be the next best solution for this issue? The loading times seem to be very long when the script runs for 75 or more sheets. Any suggestion or advice is welcome on how to proceed!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:17:13+00:00Added an answer on June 15, 2026 at 4:17 am

    7My fairly simple advice would be, wherever possible, try to do your gets and sets in batches, and not within loops. So it is generally better to construct a Javascript array, and set it in one go. Below is my guess at some code:

    function consolidate() {
      var agents = [['John', 'sheet_id'],
                    ['Mary', 'sheet_id'],
                    ['Tom', 'sheet_id']];
      var numAgents = agents.length;
      var array1 = [];
      var array2 = [];
      var array3 = [];
      var array4 = [];
      var masterSheet = SpreadsheetApp.getActive().getSheetByName('MASTER');
      var sheetName = 'WEEK ' + (masterSheet.getRange('A1').getValue());
      var temp;
    
      for (var i = 0; i < numAgents; i++) {
        temp = SpreadsheetApp.openById(agents[i][1]).getSheetByName(sheetName).getRange('D41:D49').getValues();
        array1.push([agents[i][0]]);
        array2.push([temp[4][0], temp[0][0]]);
        array3.push([temp[7][0], temp[8][0]]);
        array4.push([temp[6][0]]);
      }
    
      masterSheet.getRange(2, 1, numAgents, 1).setValues(array1);
      masterSheet.getRange(2, 4, numAgents, 2).setValues(array2);
      masterSheet.getRange(2, 9, numAgents, 2).setValues(array3);
      masterSheet.getRange(2, 14, numAgents, 1).setValues(array4);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a git repo which has a few branches - there's the master
i see that this question has been answered: Are there nested master pages in
I have a master excel document with more than 300 worksheets inside. I want
In ASP.NET MVC there are generic master views ( ViewMaserPage<T> ). But what is
I have a program where there is a master/slave setup, and I have some
Lets say I'm doing a rebase B of a branch onto master and there's
I would like to implement a cascading combo selection where there is a master
I have a TPT inheritance in my EF model. Where there is a Master
There are two table s : one is the master and one the detail
I have a master page, there's only one menu item and a contentplaceholder there.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.