Hello Dear Community,
Can anyone help me please? what am i doing wrong here?
IfCell and IsCell are sport names
SumCell is scores they achieved
Can anyone help me please? what am i doing wrong here?
IfCell and IsCell are sport names
SumCell is scores they achieved
VBA Code:
Sub test()
Dim IfCell As Range, lr As Long
Dim IsCell As Range
Dim SumCell As Range, lr1 As Long
Dim ResultCell As Range
Dim CriteriaValue As String
lr = Cells.Find("*", , xlValues, , xlRows, xlPrevious).Row
lr1 = Cells.Find("*", , xlValues, , xlRows, xlPrevious).Row
Set IfCell = Sheets("DATA").Range("ae25:ae2000")
Set IsCell = Sheets("HISTOR").Range("F41")
Set SumCell = Sheets("DATA").Range("AF25:AF2000")
Set ResultCell = Sheets("HISTOR").Range("J41")
CriteriaValue = "<>"
ResultCell = WorksheetFunction.SumIfs(SumCell, IfCell, IsCell)
End Sub