0
I tried several ways and none worked.
I want a function that when someone types something, the cell content automatically becomes all uppercase and no accents.
E.g.: if I type "aaaauu", it immediately becomes "AEIOAAUU".
What I’ve already tried:
- change the accent letter to a letter without and then capitalize everything, all in the same onEdit;
- separate functions into different onEdit, in the same script;
- an onEdit calling functions in other scripts.
This is my code:
function onEdit(e){
try{
myA(e);
myE(e);
myUpper(e);
}
catch(e){
if(e){}}
}
function myFunction(){
var app= SpreadsheetApp;
var targetSheet= app.getActiveSpreadsheet().getSheetByName("Sheet1");
onEdit();
}
The functions "Mya", "Mye" and "myUpper" are each in a separate script and they are:
function myUpper(e) {
e.range.setValue(e.value.toUpperCase());
}
function myE(e) {
e.range.setValue(e.value.replace(new RegExp("[[éèêëÉÈÊË]", 'g'),"E"));
}
function myA(e) {
e.range.setValue(e.value.replace(new RegExp("[[áàâäãÁÀÂÄÃ]", 'g'),"A"));
}
Running the code, only the "Mye" function works. That is, only the letters "and" with accent become "E".
What am I doing wrong?
From now on, thank you very much.