Tuesday 24 May 2022

Get all selected Ranges in a Google Sheet

The following Google Apps Script was from some learning around multiple ranges being selected/highlighted by a user in a Google Sheet. I have always worked with individual cells or continuous ranges within Sheets, but during the development of my Archive Sheet data Add-on I wanted to enhance it by allowing more rows to be acted upon in one go.

I practiced getting a few values after looping through each selected range:

  • A1 Notation (e.g. A2:C5),
  • Cell values,
  • Starting row,
  • End row,
  • Number of rows (calculated from the above),
  • Starting column,
  • End column,
  • Number of columns (calculated from the above).
Selected ranges in a Google Sheet
Selected ranges in a Google Sheet

Tuesday 10 May 2022

Bulk convert Excel files to Google Sheet files

As of February 2023 'Convert Drive Files' is now available as a Google Workspace Marketplace Add-on.

The following Google Apps Script is designed to iterate through a Google Drive folder of Microsoft Excel files and convert them all to individual Google Sheet files. It does not technically check a file is Excel only (eg you may have a Word document in there), but it is recommended to only try from Excel to Google Sheets otherwise the data may be unreadable.

Bulk convert Excel files to Google Sheets
Bulk convert Excel files to Google Sheets