尝试使用以下功能时出错。奇怪的是,错误发生在名称
中代码:
Function DATECHECK(rng As Range, date_time As Date) As Boolean
For Row = 1 To rng.Rows.Count
'Stuff'
Next Row
End Function
语法:
DateCheck(Sheet2!A2:B561, Sheet1!A2)
错误:
#NAME
#NAME(Sheet2!A2:B561, Sheet1!A2)
答案 0 :(得分:2)
DateCheck = 1
。Row
是一个变量。如果您使用dim row as long
,则需要将其声明为长(例如Option Explicit
)。