Комментарии:
Thank you so much! This worked for me. :)
ОтветитьAmazing, this helped me a lot! :)
ОтветитьProcuro algo assim para menu de navegação. Alguém já desenvolveu algo ?.
ОтветитьI need a help.can you please help me?
Ответитьthank you so much this works so well!
ОтветитьOMG thank you so much! This is exactly what i need... i'm creating a worksheet for testing spanish conjugation and i need to be able to clear the answers from the spreadsheet after every use (1 student, my partner, who wants to use this for practice drills). I copied your code but left out the sheetName requirement, and i feel like i've gotten all the code right, but it's not getting activated on edit.
I've run the OnEdit manually from the Apps Script and it works when i have the correct checkbox marked, but when i go to the actual spreadsheet and click the checkbox it's not doing anything. I was wondering if you or anyone else had any thoughts on this. My functions work when i run them manually or when i run them using the buttons i made. Here's my code! (please don't make too much fun of my code i'm a newb 😅)
/** @OnlyCurrentDoc */
function OnEdit() {
let activeCell = SpreadsheetApp.getActiveSpreadsheet().
getActiveCell()
let reference = activeCell.getA1Notation()
let activeValue = activeCell.getValue()
if (reference == 'F3' && activeValue == true) {
ClearColG()
}
}
function ClearColG() {
var sheet = SpreadsheetApp.getActive();
sheet.getRange('G:G').clearContent();
sheet.getRange('F3').setValue(false);
}
function UncheckAll() {
var sheet = SpreadsheetApp.getActive();
sheet.getRange('H:H').setValue(false);
}
This is great. On one issue. I added the counter to my already existing sendEmail function. I commented out the for loop so it would send a hundred emails while I tested this thing. It working perfectly. But then I removed the comments /**/ from the loop and not it isn't working. Any suggestion? For your reference, the sheet is "Campaign" and the checkbox cell is H2.
function sendEmails() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Campaign');
var range = sheet.getRange('B10:B');
var values = range.getValues();
let counter = sheet.getRange("F2");
counter.setValue(counter.getValue()+1);
for (var i = 0; i < values.length; i++) {
if (values[i][0] === false) {
var recipientEmail = sheet.getRange('G' + (i + 10)).getValue();
var replyToEmail = sheet.getRange('M' + (i + 10)).getValue();
var subject = sheet.getRange('O' + (i + 10)).getValue();
var message = sheet.getRange('N' + (i + 10)).getValue();
MailApp.sendEmail({
to: recipientEmail,
replyTo: replyToEmail,
subject: subject,
body: message
});
}
}
}
function onEdit(){
let activeCell = SpreadsheetApp.getActiveSpreadsheet().getActiveCell()
let reference = activeCell.getA1Notation()
let sheetName = activeCell.getSheet().getName()
let activeValue = activeCell.getValue()
if(reference=="H2" && sheetName=="Campaign" && activeValue==true){
sendEmails()
activeCell.setValue(false)
}
}
Thanks for this, I have attempted to utilize this in my script but I have not had any luck getting it to work. I am fairly new to the scripting and I am not sure how to go about troubleshooting, I have copied your script exactly other than the counter. any recommendations would be great.
ОтветитьThanks!
ОтветитьThis video was great and easy to follow along. Much appreciated actually talking through the meaning of the commands used also!
This seems like the ideal fix for my situation , but I was unable to get it to work in the last step (with the checkbox). My script runs within the basic onEdit function, but when I try to tie it to the specific trigger, it no longer executes (nothing happens). I've compared my code to the video's 5-6 times and don't see any differences. Thoughts?
In mobile, custom dialog is still not showing up, is there a solution for that?
ОтветитьHow about a function that access another file in drive? This code doesn’t work for me.
ОтветитьHi, thanks for this tutorial it's very helpful, I managed to copy it so that my counter function worked on my tablet, however when I replace counter with my own function in the script, it no longer runs... but that function works fine when placed in a button or as a keyboard shortcut.
Can you think of any limitations on why the onEdit function won't run another function? Would it help if I shared the code for that function with you?
Very helpful. Thank you!
ОтветитьThat was incredible! Thank you!
ОтветитьMy god I've been searching for this fo soooo long. It works perfectly well on my phone, and will help all of my coworkers. Thank you so much for sharing this !!!
ОтветитьThanks, great idea
ОтветитьThank you so much for your video. It didnt work for me. I'm not sure why. My desktop buttons work but I cannot get the script to work for the edit you made. Any thoughts? I would love to share with you the code I am using. I cannot find any information on how to get it to work any where else. Your video was the closest thing I've found.
ОтветитьThis is perfect, how would this work if you have several buttons that all do the same thing, add 1 but are in different cells and for different cells?
ОтветитьCan you create a video of how to use this button with your video “WORKOUT LOGGER GOOGLE SHEET”
ОтветитьThat's perfect, thanks a lot !
ОтветитьCould you help to use checked box on mobile to move / copy many rows to another sheet
ОтветитьVery good,
ОтветитьVery interesting. Thanks
Ответитьthis Tutorial is useful
ОтветитьHow can I add multiple buttons to the same sheet like this? I've tried but something is interfering to where the last one in the script code is the only one that's actually functioning.
ОтветитьThanks! How will it be implemented if there are several buttons and correspondingly several scripts (functions) in the table?
ОтветитьThank you so much! This is exactly what I was looking for :)
ОтветитьThat was amazing!! 😍
ОтветитьUseful to know that there is a relatively simple workaround.
Thanks.