اليك الكود بعد التعديل
Sub hhh()
Dim aa As Range, bb As Range, cc As Range, dd As Range, ee As Range, ff As Range, gg As Range, MyDate As String, MyDate2 As String
Set aa = Range("sumrange")
Set bb = Range("criteria")
Set cc = Range("range1")
Set dd = Range("criteria1")
Set ee = Range("range2")
Set ff = Range("range3")
MyDate = ">=" & CDate(cc)
MyDate2 = ">" & CDate(ff)
For i = 3 To [A10000].End(xlUp).Row
Cells(i, 2) = Application.SumIfs(aa, bb, MyDate, dd, Cells(i, 1)) - Application.SumIfs(aa, bb, MyDate2, dd, Cells(i, 1))
Next
Set aa = Nothing
Set bb = Nothing
Set cc = Nothing
Set dd = Nothing
Set ee = Nothing
Set ff = Nothing
End Sub