Hi,
I am in need of some help using SumIfs with VBA when dates are involved. Basically the variable goLiveDate is 5/1/2018 read in from cell A1 on a worksheet. dataSheet.Range("G:G") contains a range of different dates on a worksheet formatted as short date. I have tried CLng and CDate and answer still produces 0 when date comparison is added to the SumIfs. Any help appreciated.
Thanks,
Justin
I am in need of some help using SumIfs with VBA when dates are involved. Basically the variable goLiveDate is 5/1/2018 read in from cell A1 on a worksheet. dataSheet.Range("G:G") contains a range of different dates on a worksheet formatted as short date. I have tried CLng and CDate and answer still produces 0 when date comparison is added to the SumIfs. Any help appreciated.
Code:
For i = 9 To dashboardMetricsSheetLastRow
collectionTotal = Application.WorksheetFunction.SumIfs(dataSheet.Range("D:D"), dataSheet.Range("G:G"), "<" & Clng(goLiveDate), dataSheet.Range("H:H"), "=" & marketName, dataSheet.Range("B:B"), "=" & dashboardMetricsSheet.Range("A" & i))
Next
Thanks,
Justin