I would like to get a SumIFs function through VBA that uses an array as criteria. This is what I have so far.
The variables projectStatus, programs, beltDesignation and benefitType are set up as "Dim projectStatus (0 to 3) As String", for example.
In excel the formula would allow an array within "{}". That will not work in VBA.
Any help with this would be greatly appreciated.
Code:
summarySht.range("O15").Value = Application.WorksheetFunction.SumIfs(dataSht.range(janCol & ":" & janCol), _
dataSht.range(GetColumnLetter(projectStatusCol) & ":" & GetColumnLetter(projectStatusCol)), projectStatus, _
dataSht.range(GetColumnLetter(programsCol) & ":" & GetColumnLetter(programsCol)), programs, _
dataSht.range(GetColumnLetter(beltDesignationCol) & ":" & GetColumnLetter(beltDesignationCol)), beltDesignation, _
dataSht.range(GetColumnLetter(benefitTypeCol) & ":" & GetColumnLetter(benefitTypeCol)), benefitType)
The variables projectStatus, programs, beltDesignation and benefitType are set up as "Dim projectStatus (0 to 3) As String", for example.
In excel the formula would allow an array within "{}". That will not work in VBA.
Any help with this would be greatly appreciated.
Last edited: