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 8347849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:30:01+00:00 2026-06-09T07:30:01+00:00

I have a Range of all rows and columns in my Google Spreadsheet. I’m

  • 0

I have a Range of all rows and columns in my Google Spreadsheet. I’m looping through each row. If my conditional statement is true, I need to append some data to the row in the furthest to the right column.

Any pointers as to how I can achieve this? Thanks!

  • 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-09T07:30:04+00:00Added an answer on June 9, 2026 at 7:30 am

    The key point is to get the range data into an array; then iterate through the array; then write the array back. Acting on spreadsheet objects like cells is relatively inefficient.

    function writeRows() {
      // This is the named range you have.
      var range = SpreadsheetApp.getActiveSpreadsheet().getRangeByName("myRange");
    
      // Get the data and iterate through it rather than iterate through rows.
      var dataarray = range.getValues();
    
      // For each row.
      for (var rowpos = 0; rowpos < dataarray.length; rowpos++) {
        // Get the row data as array.
        var rowdata = dataarray[rowpos];
        Logger.log(rowdata.length);
    
        // Update last column in this row.
        dataarray[rowpos][rowdata.length - 1] = "value to set";
      }
      // Now write back the array values into the range.
      range.setValues(dataarray);
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have CF with 1280 rows. Each row has 6 columns. Im trying to
This is a script I have for a google spreadsheet. It all works except
I have an array of values all well within the range 0 - 63,
I have a grid (6 rows, 5 columns): grid = [ [None, None, None,
How can I select all data from GridView s current row.. I have a
I have a schema of Row Keys 1-n. In each row there are a
I have a Spreadsheet, like excel on Google Docs. I am using both Mozilla
I have range of numbers that range from 1 - 0.00000X . Most are
Suppose I have range from E2 to E16. How do I read values from
I have two range sliders in my page, and I would like to implement

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.