且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如果其他单元格内容符合条件,则返回特定单元格上的值的脚本

更新时间:2023-02-04 19:54:46

错误在于比较 cell == 5 。它应该是 cell.getValue()== 5

The mistake is in comparison cell == 5. It should be cell.getValue() == 5.

实际上,单元格是抽象表示单元格的对象:通过调用其方法之一,可以更改其值,或将背景设为红色,或设置数据验证等。 getValue 是这些方法之一,它返回单元格中包含的值。

Indeed, cell is an object that abstractly represents the cell: by calling one its methods, you can change its value, or make the background red, or set data validation, etc. getValue is one of these methods, which returns the value contained in the cell.