Questions tagged [google-sheets-macros]

Use for questions relating to Google Sheets Macros, which allow quickly replaying a set of interactions with the Google Sheets UI that normally would need to be done with the mouse, and can be bound to a keyboard sequence.

Google Sheets Macros are recorded functions written in the Google Apps Script language that allow simply repeating certain actions or procedures that would otherwise require multiple mouse & UI interactions. Up to 10 can be bound to a keyboard shortcut, using the sequences Ctrl + Alt + Shift + [0-9].

Macros can be recorded directly from the document or written in the document's Script Editor, or imported from a previous document. They are only allowed as part of a bound document - no standalone, add-on, web-app, or library macros are usable.

References

320 questions
8
votes
1 answer

google script error "You do not have permission to call create (line 38, file "macros")"

var newSpreadsheet = SpreadsheetApp.create("Spreadsheet to export"); I am running a Google Sheet script and I get the following error message on the above line of code. Any idea how to solve the issue? I am a novice. Error message: You do not have…
Omid
  • 177
  • 2
  • 2
  • 10
5
votes
1 answer

Group rows using google apps scripts

I am writing code in which a user can automatically generate a template of lesson and sub-topics. Each lesson will have 10 sub-topics. I also need to group the rows lesson-wise and topic-wise. But, I am unable to group the rows lesson-wise and…
Hadan
  • 91
  • 1
  • 10
5
votes
1 answer

Encode google sheet rows into base64 string

I have a google sheet with multiple columns. I wish to combine values of each row into an string and convert that string to base64. example: Sheet Data A1 B1 C1 D1 E1 NewYork Smith kalk …
daemonThread
  • 1,014
  • 2
  • 12
  • 23
3
votes
1 answer

getOAuthToken returns null when called from Google Sheets

I'm working on a way to limits some Google Sheets for specific users, with the oAuth specification and AWS API Gateway calls, but i'm facing a problem with the ScriptApp.getOAuthToken() function. When i'm running the code with the Google Apps Script…
3
votes
2 answers

Activate and run a recorded Macro to Multiple Google SpreadSheet/Workbook

I Have multiple spreadsheets that was copied from 1 template. Each spreadsheets works exactly the same as they were just copied from 1 template which got formulas. Is there anyway to activate and run a recorded macro to all the spreadsheets? I…
3
votes
1 answer

Overwriting Google sheets (for form response) rows if duplicate entered

So, I've been trying to figure out how to stop the duplicate rows appearing in my google sheets response output from a google form. If found this link which sounds like it does exactly what I want (Form Google Script Prevent Duplicates), but cannot…
2
votes
1 answer

Copying data after deleting empty rows in Google Sheets using Apps Script?

The following code is working fine. It is sorting, removing duplicates and deleting empty rows. Then I just want to copy the rows of data to after the last data row. But the code is copying the rows of data with empty rows. Need to avoid empty rows…
2
votes
3 answers

"Currentregion" concept in Google Sheets script language

From inside Google Sheets Script, I am trying to name a variable-sized matrix on the worksheet. In EXCEL VBA, I would go to the top left most cell and select the whole matrix using activecell.currentregion.select. This would select the whole matrix…
2
votes
1 answer

Set height and width of every chart in Google Sheets file

I'm seeking pointers (sample code is appreciated) to get started on setting the height and width of every chart in a Google Sheets file. I have to import these charts into a presentation and would prefer that they are of a specified width x height…
Vishal
  • 2,097
  • 6
  • 27
  • 45
2
votes
1 answer

How to insert several cells (not an entire row/column) using google script?

Say I have a sheet with values in all visible cells. I want to insert cells above, say, C3:D3 so that the existing values in C3:D3 and below are moved downwards. I want the columns next to C3:D3 to remain unchanged. Is this at all possible? Thank…
2
votes
1 answer

Emulate simple VBA macro to be compatible with Google Sheets

How can I convert this simple VBA to Google Sheets? Sub SELECT() Dim Cval As Variant Cval = Sheet4.Range("A16").Value Sheet4.Range("D1:T" & Cval).Select End Sub I keep getting errors while trying to use this macro in Google Sheets and I cannot…
Richa
  • 73
  • 7
2
votes
1 answer

How can I print the Google Script I have written?

I want to print the Google script I have written (ultimately into a PDF) so I can send it to someone for them to look at. I am unable to share the spreadsheet with them so I want to send it as another file but I don't want to lose the formatting.…
2
votes
2 answers

I want to use an If statement that checks the cell value for "TRUE" before proceeding

I want to use the If statement to check that the cells value is equal to "TRUE" before proceeding. I have created the below but there is one problematic line I cannot figure out. I have inserted a comment above the problematic line of script below.…
2
votes
1 answer

Google Sheets Macro Loop

I'm trying to create a way to auto 'click' macro a button on one of my sheets so that it is running autonomously. I have looked at the triggers section to create a time interval trigger every minute with the script but this hasn't worked. Is there…
2
votes
0 answers

How to copy values that have just been deleted into 'Archive' Sheet?

Setting up so any expired date rows get deleted. But I would Like to Delete and Move to Archive tab(sheet). Have tried taking other codes and integrating but cannot find the code. function DeleteOldEntries() { var ss =…
1
2 3
21 22