I would like to use this code :  function onEdit(e) {   if(e.range.rowStart === 1 &amp;&amp; e.range.columnStart === 1) {      e.range.offset(0,1).clearContent();   } }   but only on a tab called 'Inventory'. Could you kindly help?
120799
I'm currently using the below script to timestamp when an edit is made to column 7 on a sheet named "Sheet 1".  function onEdit(e) {    if ([7].indexOf(e.range.columnStart) != -1) {    e.range.offset(0, 7).setValue(new Date()).setNumberFormat("dd.MM.yyyy at HH:mm");    }   }     I have a second sheet "Sheet 2" which I need to run the same script on but against column 5.  function onEdit(e) {    if ([5].indexOf(e.range.columnStart) != -1) {    e.range.offset(0, 7).setValue(new Date()).setNumberFormat("dd.MM.yyyy at HH:mm");    }   }     I've tried .getSheetByName("Sheet1") but just cant seem to get it working correctly.
27538
I have a document with some tabulars one after the other.  I want the tabulars begin on a new page if there is very little room left on the actual page, like 1/4th.  Otherwise, there should not be a pagebreak.  So I need some kind of conditional \pagebreak, how can I do this?
22401
This is similar to:  and , but is slightly different. The other questions are asking more of a why question, not a please do this question. I am asking for a specific implementation of Markdown tables. I found  on making tables in Markdown using  or . The code to make a table looks like this:  | Left align | Right align | Center align | |:-----------|------------:|:------------:| | This       |        This |     This     | | column     |      column |    column    | | will       |        will |     will     | | be         |          be |      be      | | left       |       right |    center    | | aligned    |     aligned |   aligned    |   And the result is:   This is much different than , which says that Jeff doesn't want the &lt;tr&gt;&lt;td&gt; tags allowed on the SE sites. This request has a specific feature request, as opposed to the other questions which don't really have a decisive yes/no answer.  Here are some specific posts that need this type of support:
107111
Upon page load I want to move the cursor to a particular field.  No problem.  But I also need to select and highlight the default value that is placed in that text field.
5646
Basically, I need to do what the title says on my spreadsheet here. So for row 3, I need to find the address of the last non-blank cell in that row, while skipping the grayed out columns (with the header "Total").
122624
I have created 50 spreadsheets for 50 students. Each spreadsheet contains 33 sheets, numbered 1 to 33, along with a couple of other sheets.  Within each of these 33 sheets, there are many protected ranges.  I accidentally protected a range that ought not to have been protected. So, with 50 students each having 33 sheets, I have over 1800 sheets to unprotected.  I want to loop through each sheet, 1 to 33, and remove protection from cell F15. Right now, I (the owner) am the only editor.  Since I'm not an actual programmer, I've clearly not done this properly.  Can someone offer a suggestion of how I can change my Google Script to make this work?  var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheets = ss.getSheets();  for (var i=2; i  &lt;sheets.length; i++) {   var sheet = ss.getSheets()[i];   sheet.activate();   SpreadsheetApp.flush();   var range = sheet.getRange('F15');        var protection = range.protect().setDescription('Protected range');        var me = Session.getEffectiveUser();        protection.addEditor(me);        protection.removeEditors(protection.getEditors());        if (protection.canDomainEdit()) {          protection.remove();          } //end of if statement  }
34951
It's a really basic question but i can't think at the second. How do i set up a loop that asks each time the function inside runs whether to do it again. So it runs it then says something like;  "loop again? y/n"
110293
I am trying to work out what script is required to have multiple timestamps on several tabs however each one I have tried doesn't work for me.  I am new to this. When text is added to column 2 I need a timestamp in column 1.  When text added in 8 I need a timestamp in 7.  When 15 which is a checkbox, a timestamp in 16, and when 18, timestamp in 17.  Is this possible to have so many? My current script is as follows and this is giving me the time stamp in column 1 when column 2 is amended and it doesnt overwrite when it is changed a second time. function onEdit(e) {   var row = e.range.getRow();   var col = e.range.getColumn();   if (col === 2 &amp;&amp; row &gt; 1 &amp;&amp; e.source.getActiveSheet().getName() === &quot;June 2021&quot;) {     if (e.source.getActiveSheet().getRange(row, 1).getValue() == &quot;&quot;) {       e.source.getActiveSheet().getRange(row, 1).setValue(new Date());     }   } }
8344
I'm working with a bit of html and Javascript code that I've taken over from someone else. The page reloads a table of data (via an asynchronous request) every ten seconds, and then re-builds the table using some DOM code. The code in question looks something like this:  var blah = xmlres.getElementsByTagName('blah'); for(var i = 0; i &lt; blah.length; i++) {     var td = document.createElement('td');     var select = document.createElement('select');     select.setAttribute("...", "...");     select.onchange = function() {         onStatusChanged(select, callid, anotherid);     };     td.appendChild(select); }   When the onchange event is fired for a &lt;select&gt; element however, it seems like the same values are being passed to the onStatusChanged() method for every &lt;select&gt; in the table (I've verified that in each iteration of the loop, callid and anotherid are being given new, distinct values).   I suspect this is occuring because of the nature of how I am setting the event handler, with the select.onchange = function() syntax. If I understand how this is working correctly, this syntax sets a closure for the onchange event to be a function which refers to these two references, which end up having a final value of whatever they are set to on the last iteration of the loop. When the event fires, the value referenced by callid and anotherid is the value set in the last iteration, not the value set at the individual iteration.  Is there a way that I can copy the value of the parameters I am passing to onStatusChanged()?  I've changed the title to better reflect the question and the accepted answer.
120657
Suppose, I have the following code:  \documentclass{article} \begin{document} We have totally 7 columns, describing the user: \begin{enumerate} \item ID --- users.name \item Forename --- users\_profiles.first\_name \item Surname --- users\_profiles.last\_name \item Email --- users.mail \item Primary Service --- services.name \item Start date --- FROM\_UNIXTIME(users.created) \item Employment Status --- users\_profiles.employment\_status \end{enumerate} \end{document}   Producing this document:    Is it possible to set the value 7 automatically, depending upon number of elements in the list? The problem is, that it resides before the list.
82891
I would like to use the exportRange Function and set the target to off center by one column.  How can I accomplish this?  function exportRange()      {    var import = SpreadsheetApp.openById('1KTvAvC6UCePjyEiOmyTlCokdiHMwYbKBJRAKDxaAIPQ');    var ss = import.getSheetByName('Business Division Master Contact List');     var SRange = ss.getRange(3,1,ss.getLastRow(), 16);         //Get full range of data    var A1Range = SRange.getA1Notation();    //get A1 notation id the range    var SData = SRange.getValues();          //get the data values in range     var tss = SpreadsheetApp.openById('1bfew3H4gluutxuo1tDRr8rwNCZHSuw16oHYthT_f8CM');    var ts = tss.getSheetByName('Business Contact List'); // ts = target sheet    ts.getRange(A1Range).setValues(SData);   //set the target to the source values   }
44152
How can I get a user-defined function to re-evaluate itself based on changed data in the spreadsheet?  I tried F9 and Shift+F9.  The only thing that seems to work is editing the cell with the function call and then pressing Enter.
49643
The "select an area by dragging across the lower chart" thing is not working on Chrome.  Tested with Chrome 13.0.782.220 m, works with Firefox 6.0.1 and IE 8  Quirk: For some reason, if I open an incognito window, it works. Tried clearing the cache and cookies, still not working.
53873
I'd like to pull values from a named range into a calculation. I have this function:   function getNamedRange(n){   SpreadsheetApp.getActiveSpreadsheet().getRangeByName(n); }   Seems pretty simple. I have a named range called "budgetItems". It definitely exists and has about 6 values in it. But when I try to pull the values with    var items = getNamedRange("budgetItems"); items.getValues();   it usually says items is null. I've gotten it to work in the past but it seems really flaky. I suspect there is eventual consistency and caching goofing things up here.   I've attached this function (to pull the values from the range) to a menu item. When I run that menu item it takes about 15s to run 5 lines of js -- and then fails. That's... suspicious.
99955
I am completely new to making spreadsheets with Excel and even more dumb when making formulas. I have come to surprise myself how much I have learned, but now I am stumped and could really use some help and hope I explain this clear enough.    On my spreadsheet I have (A-I) columns. Column E is entered data (in this case # of loads I ordered for that day). Column G is entered data (for how many loads were rejected (not picked up)). Column H is entered data (for how many loads are picked up). Column I is for how many loads are left.   Now with that description my formula is as follows in column I:   Row 8 is where my data starts (=E8-G8-H8) this gives me my total in column I. On I9 this is my formula (=I8+E9-G9-H9)   This works like I want it to but my problem is that it shows my last result all the way down the column. I want to hide those results until data is entered in column E.  How can I accomplish that?
52026
There is this question regarding adding checkbox functionality to Google Drive: . And a great  is:     In the Google Sheets spreadsheet go to Tools -> Script Editor.   Enter the following code:   function onEdit() {   if(SpreadsheetApp.getActiveRange().getValue() == 1) {     SpreadsheetApp.getActiveRange().setValue('=CHAR(10004)');     SpreadsheetApp.getActiveRange().setBackgroundRGB(0,255, 0);   }   if(SpreadsheetApp.getActiveRange().getValue() == 0) {     SpreadsheetApp.getActiveRange().setValue('=CHAR(10060)');     SpreadsheetApp.getActiveRange().setBackgroundRGB(255, 0, 0);   } }      Enter into any cell a 1 for a tick, and a zero for a cross.    This code is great and it works beautifully, but I would like to know how to ONLY apply that to a range of cells and not to the whole spreadsheet.  By example, cells: G25 x I47
56516
I have two columns in Excel, and I want to find (preferably highlight) the items that are in column B but not in column A.   What's the quickest way to do this?