Borut
06-01-2021, 11:41 AM
In sheet 1 I have one part of te code with sumif. It works fine, if I run from this sheet.
But when I like to run it from another sheet dont work. I didnt found solution.
Part of the of this Code with sumif is (b is interger from 10 to 500):
If Application.WorksheetFunction.SumIf(Range(Cells(b + 4, 2), Cells(b + 36, 2)), Worksheets("Podatki").Range("i22"), Range(Cells(b + 4, 11), Cells(b + 36, 11))) > 0 Then
(this in run fine from sheet 1 and works ok).
but can not write the code, that run from another sheet (something like this):
If Application.WorksheetFunction.SumIf(Worksheets("test").Range(Cells(b + 4, 2), Cells(b + 36, 2)), Worksheets("Podatki").Range("i22"), Worksheets("test").Range(Cells(b + 4, 11), Cells(b + 36, 11))) > 0 Then
solution?
Regards.
But when I like to run it from another sheet dont work. I didnt found solution.
Part of the of this Code with sumif is (b is interger from 10 to 500):
If Application.WorksheetFunction.SumIf(Range(Cells(b + 4, 2), Cells(b + 36, 2)), Worksheets("Podatki").Range("i22"), Range(Cells(b + 4, 11), Cells(b + 36, 11))) > 0 Then
(this in run fine from sheet 1 and works ok).
but can not write the code, that run from another sheet (something like this):
If Application.WorksheetFunction.SumIf(Worksheets("test").Range(Cells(b + 4, 2), Cells(b + 36, 2)), Worksheets("Podatki").Range("i22"), Worksheets("test").Range(Cells(b + 4, 11), Cells(b + 36, 11))) > 0 Then
solution?
Regards.