1 Answers
// 判断A列的日期是否为今天,如果是的话,打印行号


// 获取当前工作表
const currentSheet = ActiveSheet
// 获取当前工作表的使用范围
const usedRange = currentSheet.UsedRange
// 获取A列
const columnA = currentSheet.Columns("A")
const now =new Date()
var today = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0)

// 遍历每一行
for (let i = usedRange.Row; i <= usedRange.Row + usedRange.Rows.Count - 1; i++) {
  // 获取当前行的A列
  const currentCell = columnA.Rows(i)
  // 获取当前单元格的时间
  const currentDate = new Date(currentCell.Text)
  // 判断当前时间是否为今天
  if (currentDate.getTime() === today.getTime()) {
    // 如果是今天,打印行号
    console.log(`A列第${i}行的时间为今天`)
  }
}