x = WorksheetFunction.SumIfs(Worksheets("Data").Range("D:D"), Worksheets("Data").Range("B:B"), Worksheets("List2").Range("D8"), Worksheets("Data").Range("C:C"), Worksheets("List2").Range("E8"))
Učesaná verze:Dim wsData As Worksheet
Dim wsList2 As Worksheet
Dim oblastB As Range
Dim oblastC As Range
Dim oblastD As Range
Dim parametr1 As Range
Dim parametr2 As Range
Set wsData = Worksheets("Data")
Set wsList2 = Worksheets("List2")
Set oblastB = wsData.Range("B:B")
Set oblastC = wsData.Range("C:C")
Set oblastD = wsData.Range("D:D")
Set parametr1 = wsList2.Range("D8")
Set parametr2 = wsList2.Range("E8")
'**** zaokrouhlit **********
parametr2 = WorksheetFunction.Round(parametr2, -1)
'***** SUMIFS **************
y = WorksheetFunction.SumIfs(oblastD, oblastB, parametr1, oblastC, parametr2)
Teď co s tím dál?
Kdy to spustit - tlačítko, událost...
Co počítat - jeden řádek, více řádků ....