Excel 2007中的Excel VBA函数类型缺失匹配

时间:2018-08-19 10:06:00

标签: excel-vba excel-formula

我正在自定义一个功能以根据日期列表验证工作日。我可以在2010年及更高版本中运行该功能,而在Excel 2007中却出现错误。请咨询

Function NSEBDay(InPut_Date As Date) As Date
Dim MyDate As Date
Dim Hday As Range
Set Hday = wksBackup.Range("TSys_NSEHoliday")
MyDate = Application.Evaluate("=workday(""" & DateAdd("D", InPut_Date, 1) & """,-1," & Hday.Address(0, 0, External:=True) & ")")
If InPut_Date = MyDate Then
    NSEBDay = MyDate
Else
    MyDate = Application.Evaluate("=workday(""" & InPut_Date & """,1," & Hday.Address(0, 0, External:=True) & ")")
End If

End Function

0 个答案:

没有答案