New answers tagged

0

You want to use two cells to track the balance owing (Cell A1) and the total amounts paid (Cell2) by clients. It should be noted this approach is fraught with danger since any mis-type may have the effect of rendering the cumulative values of Cells A1 and A2 incomprehensible. Why your script doesn't work. Two reasons: first, there can only be one onEdit() ...


0

If you wish it to treat a string of numbers as text, this can be done by preceding the string of numbers with an apostrophe ('). You won't be able to use that number for future calculations, but if you are just keeping a record of a number or using it as the name of something, then that's your fix.


0

The referred error message means that ss.getSheetByName('Template') in sheet = ss.getSheetByName('Template'); returned null. This occurred because your spreadsheet doesn't include a sheet named Template.


0

Try: Cell B11: =transpose(arrayformula(REGEXREPLACE(B8:H8,"☀️☀️☀️☀️☀️","⭐️"))) Cell C11: =transpose(arrayformula(REGEXREPLACE(B9:H9,"☀️☀️☀️☀️☀️","⭐️")))


0

I solved it after a few more hours of digging through documentation. The openById() function does not return a list of slides. Using getSlides() provides a list of slides through which the for loop can iterate. So // append org1 slides var org1Slides = SlidesApp.openById('{presentation id hidden}'); currentPresentation.appendSlide(org1Slides.getSlides()...


-1

There is no direct way to convert VBA code to Google Apps Script. You could use the VBA to get an idea of the "spreadsheet thinking", algorithm and the programming abstract concepts (i.e. read, write, loops) used but you should translate them to Google Sheets, Google Apps Script / JavaScript. If you are not familiar with Google Sheets, please bear ...


-1

What you can do is make the table on Google Sheets and then put it in the Google Docs, Here's how to do it on google sheets... First, click on the cell that you want to limit the characters in Then click "Data validations" Then go to Custom Formula And input "=(len($C2)>=500)*(len($C2)<=2000)" this is for cell C2 change "$C2&...


-1

There isn't a built-in feature that does that you might use a custom sidebar to hold client-side code to constantly poll the document to count the character of the active Google Docs element by using Google Apps Script or use a Google Docs add-on that does that if its exists.


0

You want to list GDrive files that are recently created, either "today" or within a time span that you decide. Your existing script doesn't include a value for the date that a created was created. I suggest that there are two options, both of which include adding dateCreated() to the information obtained via the script. Option#1 - Date comparison ...


0

You are having this problem because you are running the script from the Script Editor. When you do this, the event objects aren't created - this is why "values" is described as "undefined". You are using an onformsubmit trigger and event objects are created ONLY when a form is submitted. Your spreadsheet must contain the Response sheet ...


0

I think what you were looking for was: sheet.setActiveRange(range.offset(i+10,0,1,1));


1

Answer to the original question I've created the following function: function Merge() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var s = ss.getSheetByName('Schedule'); const range = s.getRange("B3:H20"); const numRows = range.getNumRows(); const numCols = range.getNumColumns(); for (let i = 1; i <= numCols; i++) {...


2

You can use the following Google Apps Script function to do it: function mergeFunction() { const spreadsheet = SpreadsheetApp.getActive(); const range = spreadsheet.getActiveRange(); let numRows = range.getNumRows(); let extra = 0; let idx = 1; while(idx <= numRows) { spreadsheet.getActiveSheet().insertRowAfter(idx+extra); ...


0

By exclusively using Google Apps Script there is no way to add a custom button to the Gmail toolbar to call a script. You could create a Gmail add-on that will show a sidebar with custom button, text boxes etc. You could create a bookmarklet, use Greasemonkey / Tampermonkey or another similar web browser extension to use a "user script" and the ...


0

Thank you Joni — your code snippet was useful and I've tweaked it slightly: function onEdit() { var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Chart"); var title = sheet.getActiveCell().getValue(); var chart = sheet.getCharts()[0];// in my case I had only 1 chart on this sheet chart = chart.modify().setOption('title', ...


0

From the question: So, is there any way to enable the disabled trigger programmatically? There isn't. The alternative is to use Babel or something like that that could make your code work on the old Google Apps Script runtime (Mozilla Rhino) Reference https://developers.google.com/apps-script/reference/script/trigger


Top 50 recent answers are included