Hello,
I wanted to write a macro with function SUMIF, however I'm stack with reference to sheets based on value.
What is working:
Cells(12 + TotalRows + 1, 4 + g).Formula = "=SUMIF('400005000'!C1,Main!RC3&Main!R11C,'400005000'!C7)"
I want however to use instead of '400005000' something like Sheets(j) where "j" is variable (sheet number). I imagine it as something like that (below) however it doesn't work.
Cells(12 + TotalRows + 1, 4 + g).Formula = "=SUMIF(Sheets(j)!C1,Main!RC3&Main!R11C,Sheets(j)!C7)"
Bookmarks