如何使用 onChange 事件通过 Google Sheets Apps 脚本检测已删除的行

How to use onChange event to detect deleted rows with a Google Sheets Apps Script

onChange event has the "REMOVED_ROW" type for a SpreadsheetTriggerBuilder

但是,我在文档中的任何地方都看不到一种方法来查看从事件中删除了哪些行。有没有办法获取随此事件删除的行号?

您可以使用 getActiveRange()。当用户删除一行时,它会自动 select 删除行下方的行。