prestopr
05-08-2012, 04:30 PM
I am seeking assistance with the worksheet function sumifs to sum the contents of a column if it meets multiple criteria.
It all works well until I introduce dates i.e. if between two dates.
Here is the relevant parts of the code.
Dim objLab As Range, objPit As Range, objSamples As Range, objmDate As Range
Dim strLab As String, strPit As String, strCost As String, strSamples As String, strsDate As String, streDate As String
'strSamples = WorksheetFunction.SumIfs(objSamples, objLab, strLab, objPit, strPit, objmDate, ">=" & strsDate, objmDate, "<=" & streDate)
'strCost = WorksheetFunction.SumIfs(objCost, objLab, strLab, objPit, strPit, objmDate, ">=" & strsDate, objmDate, "<=" & streDate)
any assistance would be greatly appreciated
It all works well until I introduce dates i.e. if between two dates.
Here is the relevant parts of the code.
Dim objLab As Range, objPit As Range, objSamples As Range, objmDate As Range
Dim strLab As String, strPit As String, strCost As String, strSamples As String, strsDate As String, streDate As String
'strSamples = WorksheetFunction.SumIfs(objSamples, objLab, strLab, objPit, strPit, objmDate, ">=" & strsDate, objmDate, "<=" & streDate)
'strCost = WorksheetFunction.SumIfs(objCost, objLab, strLab, objPit, strPit, objmDate, ">=" & strsDate, objmDate, "<=" & streDate)
any assistance would be greatly appreciated