GAS | Convert spreadsheet column numbers and alphabetic column names.

When specifying a column in GAS, the column number is basically more convenient. Because you can also do addition and subtraction.

However, when you want to get the entire column in the sheet, you have to write the following using the column name, and there are times when you want to convert the column number and column name.

Column number → Column name

Column name → Column number

Not recommended method

I sometimes see code like the following, but it uses the method of the sheet class that is originally unnecessary, so it is not recommended.

Column names are completely regular, so you can convert them without calling unrelated sheet methods. With a standalone GAS project, you may not be able to get an active sheet in the first place.

Let's go as simple as possible!

Leave a Reply

Your email address will not be published. Required fields are marked *