Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The VBA code to perform the Sumifs function is:

Application.WorksheetFunction.Sumifs(Range("sum_range"), Range("criteria_range_1"), "criteria_1", Range("criteria_range_2"), "criteria_2")

Where: - "sumrange" is the range of cells to sum. - "criteriarange1" and "criteriarange2" are the ranges of cells containing the criteria. - "criteria1" and "criteria2" are the criteria to apply to "criteriarange1" and "criteriarange_2", respectively.

You can also add more criteria ranges and criteria values by continuing to add arguments to the Sumifs function.