Dear all


I am struggling with seemingly very simple thing. The following SumIfs returns 0 in the VBA:

test = Application.WorksheetFunction.SumIfs(Sheets("Operational data").Range("B:B"), Sheets("Operational data").Range("A:A"), ">=" & start_date, Sheets("Operational data").Range("A:A"), "<=" & end_date)
start_date and end_date are dates defined at the beginning of each run and are 100% correct, i.e. they are date and start_date is lower than end_date. Range("B:B") stores the numbers I need to sum, Range("A:A") stores the dates associated with the numbers. When I apply the same formula in the Excel itself, it works like a charm:

=SUMIFS('Operational data'!B:B,'Operational data'!A:A,">=" & start_date,'Operational data'!A:A,"<=" & end_date)
In this case, "start_date" and "end_date" are names of the cells, where the date is stored. Can anybody help please to make the VBA version of this simple function working?

Thanks a lot,
Ivan