Answer the question
In order to leave comments, you need to log in
How do I make the first letter in a cell capitalized?
https ://docs.google.com/spreadsheets/d/1vqKnsN_8qQ... it is written that it can delete, change my files on the disk.
I write only one word in a cell - first name or last name or patronymic and I would like the first letter to be capitalized - is this possible?
without creating somewhere in the side of the range
I am familiar with the formula =PROPER(P2), but I would like it to change exactly in the cell in which I enter the name.
Answer the question
In order to leave comments, you need to log in
You need to add the following code to the Table Scripts project
/**
*
* @param {GoogleAppsScript.Events.SheetsOnEdit} e
*/
function onEdit(e) {
const allowRanges = [
{ sheetName: 'Заглавная буква', cells: ['B2', 'B3', 'B4'] },
{ sheetName: 'Стартовая страница', cells: ['B2', 'C2', 'D2'] },
]; // Список
const sheetNames = allowRanges.map(r => r.sheetName);
if (e && e.range) {
const sheet = e.range.getSheet();
if (
sheetNames.indexOf(sheet.getName()) > -1 &&
allowRanges.find(r => r.sheetName === sheet.getName()).cells.indexOf(e.range.getA1Notation()) > -1
) {
const value = '' + e.range.getValue();
e.range.setValue(value.slice(0, 1).toLocaleUpperCase() + value.slice(1).toLocaleLowerCase());
}
}
}
Doesn't work for a group of cells
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question