I am wanting to get a value from a table by using the SUMIFS function within a VBA routine
I am using the following code
to get what should be a value of 168 but it is returning 0.
When I recreate this in Excel using the formula - SUMIFS(tbl_Assigned[Assigned],tbl_Assigned[Name],Resource!B5,tbl_Assigned[Role],Resource!C5,tbl_Assigned[Date],">="&Resource!E5,tbl_Assigned[Date],"<="&Resource!F5)
I get the correct result.
I have checked and triple checked that the ranges in the VBA function are correct and the string and date values are also correct.
I am using the following code
Code:
Application.WorksheetFunction.SumIfs(rngAssFTE, rngAssPerson, strPerson, rngAssRole, strRole, rngAssDate, ">=" & dtRoleStart, rngAssDate, "<=" & dtRoleEnd)
When I recreate this in Excel using the formula - SUMIFS(tbl_Assigned[Assigned],tbl_Assigned[Name],Resource!B5,tbl_Assigned[Role],Resource!C5,tbl_Assigned[Date],">="&Resource!E5,tbl_Assigned[Date],"<="&Resource!F5)
I get the correct result.
I have checked and triple checked that the ranges in the VBA function are correct and the string and date values are also correct.