All Questions

Filter by
Sorted by
Tagged with
1 vote
2 answers
2k views

Scraping data to Google Sheets from a website that uses JavaScript

I am trying to import data from the following website to Google Sheets. I want to import all the matches for the day. https://www.tournamentsoftware.com/tournament/b731fdcd-a0c8-4558-9344-2a14c267ee8b/...
100 votes
30 answers
216k views

Determining the last row in a single column

I have a sheet with data in cols A through H. I need to determine the last row in column A that contains data (it's all contiguous - no gaps in the data/rows). There is also data in the other ...
  • 1,447
3 votes
2 answers
6k views

What does the range method getValues() return and setValues() accept?

I want to get a range from my sheet. As recommended in Best practices, I am trying to get a array and manipulate it, but I'm confused: const ss = Spreadsheet.getActive(), sh = ss.getSheetByName(&...
  • 44.3k
121 votes
21 answers
112k views

Refresh data retrieved by a custom function in Google Sheet

I've written a custom Google Apps Script that will receive an id and fetch information from a web service (a price). I use this script in a spreadsheet, and it works just fine. My problem is that ...
  • 5,119
4 votes
2 answers
5k views

Long processing time likely due to getValue and cell inserts

I've just written my first google apps scripts, ported from VBA, which formats a column of customer order information (thanks to you all of your direction). Description: The code identifies state ...
6 votes
4 answers
3k views

ArrayFormula is breaking the getLastRow() funtion. Possible workarounds?

In my spreadsheet, I have a running script, which is using the getLastRow() function as an essential part of its logic. Ever since I applied the array formula in one of my columns, the getLastRow() ...
  • 1,151
123 votes
24 answers
109k views

Convert column index into corresponding column letter

I need to convert a Google Spreadsheet column index into its corresponding letter value, for example, given a spreadsheet: I need to do this (this function obviously does not exist, it's an example): ...
  • 17.4k
20 votes
1 answer
35k views

Why do we use SpreadsheetApp.flush();?

I'm a complete beginner. I read the Google Document for the solution. I searched out the internet for the same. I also searched out StackOverflow for the same. But. Everything seems technical. ...
36 votes
10 answers
27k views

How do you create a "reverse pivot" in Google Sheets?

I am trying to produce a "reverse pivot" function. I have searched long and hard for such a function, but cannot find one that is already out there. I have a summary table with anywhere up ...
1 vote
1 answer
541 views

Merging or Combining two onEdit trigger functions

I have script for Google Sheets that I collected on interwebs and got some help here. No I have 2 onEdit in conflict. I overcome that by creating script Trigger for onEdit2. It works but I don't think ...
  • 183
12 votes
3 answers
7k views

ultimate short custom number formatting - K, M, B, T, etc., Q, D, Googol

is there a way how to custom format ridiculously large numbers (at least up to 10^100 in both ways) in google sheets: thousands > K millions > M billions ...
  • 122k
41 votes
13 answers
49k views

Is there a way to evaluate a formula that is stored in a cell?

In a Google Docs spreadsheet, I'm looking for something like =EVAL(A1) where A1 is set to "=1+2". I found out that in MS Excel there is an EVALUATE() function (which seems a bit tricky to use ...
4 votes
1 answer
2k views

Moving google apps script to v8 file upload stopped working from sidebar

I have an HTML sidebar in a Google spreadsheet with a file upload input field that doesn't work with the new v8 engine. It does work in the old runtimeVersion DEPRECATED_ES5. The file upload in the ...
42 votes
6 answers
46k views

How to protect the Apps Script code in a Google spreadsheet?

I have written some code for my Google spreadsheet with the script editor. I want to share this spreadsheet with my clients but I don't want to share the code I have written. This code adds a menu ...
  • 6,660
75 votes
1 answer
117k views

Is it possible to 'prefill' a google form using data from a google spreadsheet?

I'm looking for a way to 'pre fill' a google form with specific data from a google spreadsheet. The form will have the same 'standard' questions for everyone, but the data in the first two question ...
  • 2,657
5 votes
2 answers
5k views

How can I be getting multiple unwanted event blocks from the same onFormSubmit Trigger?

I created a one question form this morning because I wanted to look at the event block for myself. However, the process took an unexpected turn for me. My description follows: I'm logging the ...
  • 57.5k
1 vote
1 answer
1k views

How to fix 'TypeError: Cannot call method "getRange" of null' in Google Apps Script

I'm setting up a script to auto-populate a template document in Google Docs using data from Google Sheets. I keep encountering the 'TypeError: Cannot call method "getRange" of null' error. How do I ...
  • 13
22 votes
2 answers
54k views

How do you resolve a "The parameters (number[]) don't match the method signature for SpreadsheetApp.Range.setValues" error

I am getting this error: "The parameters (number[]) don't match the method signature for SpreadsheetApp.Range.setValues." in my Google Apps Script when I try to write an array of values to a ...
  • 225
15 votes
2 answers
23k views

How do I make a Sidebar display values from cells?

I have a Google Sheet that I'm using as a database of clients. There are quite a lot of variables (columns) that I need to store per entry, so I thought that it would be easier to view each entry if I ...
13 votes
2 answers
29k views

Executing Google Apps Script Functions from Mobile App

I'm developing a interface for a user who uses a google spreadsheet as his database. Nowadays he uses the Google Sheet mobile App (Android and IOs) to update his spreadsheet, and I just can't find any ...
2 votes
3 answers
5k views

How to convert VBA script to Google Apps Script automatically?

VBA is the language, in which excel macros were written. Google sheets only supports Google apps script as a macro language. Is there a direct or automatic way to convert a VBA script to a Google Apps ...
40 votes
4 answers
122k views

How to automatically import data from uploaded CSV or XLS file into Google Sheets

I have a legacy database system (not web accessible) on a server which generates CSV or XLS reports to a Google Drive folder. Currently, I am manually opening those files in Drive web interface and ...
16 votes
1 answer
9k views

How to poll a Google Doc from an add-on

A documented restriction with document and sheet add-ons is that Apps Script cannot tell what a user does outside of the add-on. This tantalizing tip is given: It is possible to poll for changes in ...
  • 44.2k
28 votes
2 answers
50k views

Create Google Calendar Events from Spreadsheet but prevent duplicates

I'm trying to write a script that will take data from a Google spreadsheet and create events in my Google calendar. I managed that fine but it produced duplicates every time I ran it. So now I'm ...
8 votes
2 answers
6k views

Google Sheets OnEdit() - You do not have permission to call a service

function onEdit(e){ var html = HtmlService.createTemplateFromFile( 'MyHtmlFile' ) .evaluate() .setWidth( 800 ) .setHeight( 400 ); ...
  • 218
66 votes
17 answers
123k views

Faster way to find the first empty row in a Google Sheet column

I've made a script that every few hours adds a new row to a Google Apps spreadsheet. This is the function I've made to find the first empty row: function getFirstEmptyRow() { var spr = ...
  • 11.1k
65 votes
8 answers
143k views

How to define global variable in Google Apps Script

I see most examples from Google is they use only functions in a single giant script. e.g. https://developers.google.com/apps-script/quickstart/macros But in our style, we usually write all ...
  • 9,831
14 votes
2 answers
7k views

Google Apps Script: How to set "Use column A as labels" in chart embedded in spreadsheet?

I am using Google Apps Script and EmbeddedChartBuilder to embed line charts within my Google Spreadsheet. When you create these charts by hand, you have the (non-default) option to "Use column A as ...
  • 5,521
32 votes
4 answers
56k views

Custom function throws a "You do not have the permission required to setValue" error

I am trying to set some value to a cell in a Google Spreadsheet: function exampleFunction() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; var ...
  • 671
14 votes
5 answers
21k views

How to read the correct time/duration values from Google Spreadsheet

I'm trying to get from a time formatted Cell (hh:mm:ss) the hour value, the values can be bigger 24:00:00 for example 20000:00:00 should give 20000: Table: if your read the Value of E1: var total ...
  • 826
20 votes
6 answers
66k views

Google Spreadsheet SCRIPT Check if edited cell is in a specific range

I need to detect if changes made to a spreadsheet are being made within a certain range of data and if so, set the current update time. The issue is, I have a spreadsheet that I edit headers and text ...
14 votes
7 answers
89k views

Automatic timestamp when a cell is filled out

I have an excel formula that is very simple and it works because I can restrict the recursive iterations. I am not very script savvy, but this is what it is and it works. =IF(D24="P",IF(E24="",...
  • 145
11 votes
2 answers
9k views

button click is only working on Windows & not working on Android mobile sheet

I have created an image button in Google spreadsheet and have assigned function, to perform some action. But this button click is only working on windows and not working on Android mobile sheet or ...
153 votes
3 answers
417k views

How to get the correct range to set the value to a cell?

I want to set text or number in Google Sheet from script. I want to set Hello or number 9 in cell F2. I found this code so far: SpreadsheetApp.getActiveRange().setValue('hello'); but that doesn'...
user avatar
20 votes
4 answers
16k views

Apps Script: how to get hyperlink from a cell where there is no formula

I have a sheet where hyperlink is set in cell, but not through formula. When clicked on the cell, in "fx" bar it only shows the value. I searched on web but everywhere, the info is to extract ...
44 votes
5 answers
112k views

How do you do dynamic / dependent drop downs in Google Sheets?

How do you get a sub-category column to populate a drop down based on the value selected in the main category drop down in google sheets? I googled around and couldn't find any good solutions, ...
  • 4,697
11 votes
1 answer
2k views

Custom functions intermittently hang with "Error - Loading Data"

I have a Google Apps Script custom function, very simple: function sharesBurned(sharesToSell) { return "tree" } Obviously, this works when I test it in Apps Script. In my sheet, when ...
22 votes
5 answers
110k views

Google Apps Script, copy one spreadsheet to another spreadsheet with formatting

Hopefully this question has not already been answered. I have spent a considerable amount of time searching, and although I have found similar posts, none have done exactly what I am trying to do. I ...
17 votes
4 answers
58k views

Periodically refresh IMPORTXML() spreadsheet function

I have a large sheet with around 30 importxml functions that obtain data from a website that updates usually twice a day. I would like to run the importxml function on a timely basis (every 8 hours) ...
  • 4,349
12 votes
6 answers
30k views

How to Transpose / Rotate Multi-dimensional Array?

I'm trying to create a function that takes in any array and transpose it so that rows turns to columns and columns to rows. Not sure what I've done wrong or missing but keep getting this message once ...
18 votes
0 answers
27k views

Script to summarise data not updating [duplicate]

I have a Google spreadsheet of timesheet data; it has a sheet for each month, each sheet is a lot of six column blocks, one block per client. I have created a summary sheet that goes and gets the ...
  • 1,531
16 votes
5 answers
35k views

Detect user inserting row or column in a google spreadsheet and reacting in a script

In Google Apps Script, one of the basic tools is the onEdit trigger in a spreadsheet, which enables us to detect when a user edits a cell, and react to it. How about when a user inserts a row or ...
9 votes
1 answer
3k views

How to extract the link from a cell now that links are not reflected as HYPERLINK?

"Insert Link" is not producing a =HYPERLINK(’’,’’) anymore. Before, if you linked a cell with a value ‘X’. It was converted into the formula =HYPERLINK(*link*,’X’) Two days ago "Insert ...
0 votes
1 answer
7k views

No permission to call msgBox in Google Apps Scripting

I'm having trouble running even the simplest Google Apps Scripts, for instance when I run this script by setting a cell my spreadsheet to =pantsHate(Y) I'm getting this error: error: You do not ...
50 votes
2 answers
280k views

Sheet.getRange(1,1,1,12) what does the numbers in bracket specify?

Sheet.getRange(1,1,1,12) I cannot understand the arguments 1,1,1,12 . What is this - the sheet id or row or what? method getRange(row, column, optNumRows, optNumColumns) here what does optNumRows ...
11 votes
2 answers
12k views

Margins parameters for Google spreadsheet export as PDF

I need the margins parameter to export my spreadsheet as a pdf. I've searched for information about setting the margins parameter and can't find anything. The following parameters are working well. ...
  • 109
8 votes
3 answers
17k views

Export Single Sheet to PDF in Apps Script

I have many sheets in a Spreadsheet. I have 2 sheets that I would like to export every time. Sheet One is a sheet with the information. Sheet Two is the sheet I need to give to customers and it takes ...
  • 593
7 votes
1 answer
5k views

Retrieving Google Sheets cell border style programmatically

It is possible to set the range border style and color. Now the question is: how can we get the border style programmatically? I'm looking for something like: var ss = SpreadsheetApp....
  • 2,217
23 votes
5 answers
27k views

How to allow access for importrange function via apps script?

When you enter an importrange function manually into a spreadsheet you receive a pop up and must 'allow access'. However, I'm trying to find a way to do this via a script because I'm creating many ...
18 votes
4 answers
34k views

Google Apps Script Spreadsheet Comment Automation

Today I have a question about Google Apps Scripts, specifically for Spreadsheets. I've already looked at the documentation here (yes, documentation on a Sheet within a Spreadsheet), but I haven't been ...

1
2 3 4 5
63