Pages

Monday, 17 December 2018

Get specific sheet data - Rookie

The following Google Apps Script code was my first attempt at collecting specific data from a Google Sheet, to then translate onto another sheet. As you can see the code is a lot longer than necessary as I get each individual piece of data line by line before setting values row by row. It does however give you an idea of the process involved when scripting.

Once the code has the active spreadsheet/sheet/cell it gets the row number which will be used to acquire the specific data items via 'getRange'. A variable is then created for each of the 4 items where only the starting column number differs. Once all items have been collected the code opens the 'justOne' sheet and starts to set the values one at a time into column B.

Improved version here.

Get SpecificSheetData - Rookie.xlsx

No comments:

Post a comment