|
Sub SUMIFS_Example()
Dim ws As Worksheet
Dim condition1 As String
Dim condition2 As String
Dim condition3 As String
Dim sum_range As Range
Dim result_range As Range
Set ws = ThisWorkbook.Worksheets("Sheet1")
condition1 = ws.Range("A1").Value
condition2 = ws.Range("B1").Value
condition3 = ws.Range("C1").Value
Set sum_range = ws.Range("D1:D10")
Set result_range = ws.Range("E1")
result_range.Value = Application.WorksheetFunction.SumIfs(sum_range, ws.Range("A1:A10"), condition1, ws.Range("B1:B10"), condition2, ws.Range("C1:C10"), condition3)
End Sub |
评分
-
1
查看全部评分
-
|