I see there is not a great way to create a checkbox in Google sheets. Is there a way with a script for an X or checkmark to get placed in a cell when the cell is clicked? I'd like the script to work for all cells in column 5.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
No there isnt. You can use a menu to put the X on the selected cell but not on cell click.
回答2:
Is there a way to have the time auto fill in a cell when it is clicked? I use the following script to auto fill time when the cell to the left is edited.
function onEdit(e) {
var s = e.source.getActiveSheet(), r, colCell, nextCell;
if(s.getName() === 'SignInOut') { //checks that we're on the correct sheet
r = e.range; //s.getActiveCell();
colCell = r.getColumn();
if(colCell === 3 || colCell === 5) { //checks the column
nextCell = r.offset(0, 1);
if(nextCell.getValue() === '') //is empty?
nextCell.setValue(new Date());
}
}
}