I want to make this simple code but I didn't find any solutions to this.
I have a loop to iterate all rows of my sheet, and for every iteration I want to make a sumif, but the range is variable.
so I want something like this:
Dim row,MaxColumn as Integer
MaxColumn = 5
For row= 1 to 5
ActiveSheet.Cells(row, MaxColumn + 1).Select
ActiveCell.Formula = "=SUMIF("B2:D(here I want a variable D1 to 5 range with row variable),""=1"")"
next row
I don't know how to finish this.
I know I can use this to select a range with a variable, but I cannot use it on SUMIF.
ActiveSheet.Range("B" & row & ":D" & row)