I'm new at coding and I'm looking for the accurate syntax to define the range as the selected field.
I created a macro to change the color of the field (here for the color 'red'). I can do it on a defined field such as 'A1' or a group of fields such as'A1:Z40'.
But I tried to search for the right syntax if I want this macro works only for the current selected field.
What should I type instead of 'A1'?
function Rouge() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getRange('**A1**').activate();
spreadsheet.getActiveRangeList().setBackground('#ff0000');
}
If you will be using a spreadsheet you should know that spreadsheets have sheets, cells, ranges, rows and columns among other concepts but there aren't fields. This specially relevant in order to be able to find the information that you need on the official reference.
Regarding how to get something that could be similar to getting the "selected field", see